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 |
omega1983
Starting Member
40 Posts |
Posted - 2010-07-07 : 13:47:08
|
I have to put together two queries that do not have a common valueselect giftid,giftamount,coreid,addressfrom giftsleft outer join coreon giftid=coreidleft outer join addresson giftid=addridselect jobid,coreid,addressfrom jobsleft outer join coreon jobsid=coreidleft outer join addresson jobs=addridessentially a person can give a gift and not be an employee. Transversely a person can be an employee and not have given anything.I thought about creating two temp tables but is is better to list both queries and do a union statementAny best practices ideas that also takes into account optimization? The reason is the code must be saved and used in a crystal report for output. Also a person can only have one coreid so I also want to select a distinct coreid |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
omega1983
Starting Member
40 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|