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 |
ntn104
Posting Yak Master
175 Posts |
Posted - 2008-04-24 : 21:16:10
|
Anyone can show me the UNION...thanks, |
|
sqlleaf
Starting Member
3 Posts |
Posted - 2008-04-25 : 02:36:44
|
Just something for your consideration. I noticed that your query contains lots of "left join". Usually I'll embed left joins as follows:select fieldC1, fieldA1, fieldA2, fieldB1, fieldB2from tbl_cleft join ( select fieldA1, fieldA2, fieldB1, fieldB2 from tbl_a left join ( select fieldB1, fieldB2 from tbl_b ) as b on a.fieldA1 = b.fieldB1 ) as abon c.fieldC1 = ab.fieldA1It helps to start testing from the innermost query, and adding on the outer layers, giving each set of join result a name (e.g. ab) and treating it like a simple table. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-28 : 03:10:33
|
quote: Originally posted by ntn104 Anyone can show me the UNION...thanks,
Did you change the original question?Select columns from table1union select columns from table2MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|