|
-
Feb 20th, 2013, 09:53 AM
#1
Thread Starter
Member
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
-
Feb 20th, 2013, 10:07 AM
#2
Lively Member
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...
-
Feb 20th, 2013, 11:35 AM
#3
New Member
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.
-
Feb 20th, 2013, 12:24 PM
#4
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.
-
Feb 20th, 2013, 04:26 PM
#5
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|