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 |
|
misterraj
Yak Posting Veteran
94 Posts |
Posted - 2005-01-20 : 07:03:17
|
I have one record in table#1 which contains-------------------------order_num|sub_order_num|-------------------------and 2 records in table#2 and 13 records in table#3 and these records also have order_num and suborder_num as their primary keys and they need to be simply clubbed.i.e., i need to get 1 record + 2 records +13 recordsI used union all where i was getting 1*2*13 recordshow do i solve it. ? |
|
|
RM
Yak Posting Veteran
65 Posts |
Posted - 2005-01-20 : 07:12:57
|
| Post the query that you are using. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-01-20 : 07:56:33
|
| [code]SELECT order_num, sub_order_numFROM table#1UNION ALLSELECT order_num, sub_order_numFROM table#2UNION ALLSELECT order_num, sub_order_numFROM table#3[/code]should give you 1+2+13Kristen |
 |
|
|
|
|
|