Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Mooo0
Starting Member
4 Posts |
Posted - 2008-04-23 : 22:07:45
|
| Hello again,I am using UNION to return these 2 tables:TableAQID Q1 Name?2 Age?3 Phone?TableBQID Q1 DogName?2 CatName?When I use the following query;SELECT * FROM TableA UNION SELECT * FROM TableBI get the following return:QID Q1 whateverquestions1223but I wish it to return in order of table invoke:QID12312Is that possible? (by not changing QID)Cheers,James |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2008-04-23 : 23:10:52
|
| select *, 1 as seq from tableaunionselect *, 2 as seq from tableborder by seq, qid |
 |
|
|
Mooo0
Starting Member
4 Posts |
Posted - 2008-04-23 : 23:47:01
|
| Fantastic!Cheers! |
 |
|
|
|
|
|