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 |
|
nick2price
Starting Member
4 Posts |
Posted - 2008-04-06 : 17:03:14
|
| I want to use the select function but it is quite hard to explain but i will try. I have created several tables and added all needed constraints on them. I want to do a querry where i select all events that hire both large and small items. To do this i need to do somthing likeselect events from hireSmall and hireLargeI know thats not right but it gives u an idea. Then The eventNo in The events table is linked with a customer number in the Customer table. So in all, i need to return the event number and customer number. In all, my SQL should look somthing like:select events (that are in both) from hireSmall and hireLarge, use this events number to get customer details from customer tabelAny help? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-04-06 : 17:26:11
|
| something like:select *from(select events from hireSmall union allselect events from hireLarge) AllEventsjoin Customers C on AllEvents.CustomerId = C.Id_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
|
|
|