Results 1 to 5 of 5

Thread: HELP with SQL

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2013
    Posts
    42

    HELP with SQL

    I have a table in sql in I have to columns, which are name; Qty Desc. Is there are way I can combine the two row together on another column?
    Example:
    Qty Desc Combine
    4 Test 4Test
    11 Issue 11Issue

  2. #2
    Lively Member
    Join Date
    Apr 2011
    Posts
    75

    Re: HELP with SQL

    What flavour of SQL is it?

    This might do it...
    select Qty, Desc, Cast(Qty as varchar)+Desc as Combine from...

  3. #3
    New Member
    Join Date
    Feb 2013
    Posts
    9

    Re: HELP with SQL

    look at concat or the equivalent for your SQL you are using. It allows you to add or remove digits or whole words. you might be able to use that to create or if I understand correctly use the JOIN statement.

  4. #4
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,969

    Re: HELP with SQL

    SQL Server

    select Qty, Desc, Qty + Desc as combine

    assumining Qty is numeric

    select Qty, Desc, convert(varchar,Qty) + Desc as combine

    or

    select Qty, Desc, convert(varchar,Qty) + Desc 'combine'

    Oops...someone beat me to it.

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2013
    Posts
    42

    Re: HELP with SQL

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width