September 11, 2008 at 1:08 am
if have two table like the following:
name course
------- ---------
mahmoud c++
osam java
and the second column as the following:
name course1
--------- ---------
mahmoud db
osama c#
najeeb vb.net
yahya xml
please help me to make the following result
name course course1
--------- ---------- ------------
mahmoud c++ null
osama java null
mahmoud null db
osama null c#
najeeb null vb.net
yahya null xml
thank you
September 11, 2008 at 1:55 am
Perhaps this?
SELECT name, course, null as course1 FROM Table1
union all
SELECT name, null as course, course1 FROM Table2
Please post in the correct forum next time. The question of the day forum is only for discussions of the 'Question of the Day' as published in the newsletters
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply