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 |
|
Paul Skinner
Starting Member
9 Posts |
Posted - 2007-05-02 : 18:08:21
|
I have this database running (ignore that that was done in Access, this is being made in Microsoft SQL Server 2005). What I need to do is if you look at the tbl_events table and the tbl_timekeeperDetails table I need to make a query that:Lists the names of all timekeepers (whether they are booked for a meeting or not), and the meetings at which they are timekeeping.The tricky part of this is getting the query to show the timekeepers who aren't assigned to an event.I have two seperate querys so far, but I'm presuming there must be a way of merging them or something.I have this code so far:select timekeeperTitle,timekeeperNameFirst,timekeeperNameLast,eventIDfrom timekeeperDetails,eventswhere timekeeperDetails.timekeeperID = events.timekeeperIDselect timekeeperTitle,timekeeperNameFirst,timekeeperNameLastfrom timekeeperDetailsIf anyone has any ideas, please do post a reply or email me at paul [at] abscond [dot] orgIt would be very much appreciated. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-05-02 : 18:15:04
|
| select d.timekeeperTitle, d.timekeeperNameFirst, d.timekeeperNameLast, e.eventIDfrom timekeeperDetails as dleft join events as e on e.timekeeperid = d.timekeeperidPeter LarssonHelsingborg, Sweden |
 |
|
|
Paul Skinner
Starting Member
9 Posts |
Posted - 2007-05-02 : 18:18:57
|
| Any chance of a very quick explanation of how that works?And thank you very much. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-03 : 05:18:23
|
| how left join works?left join returns all data from the left table and nulls for the data that don't have a relationship in the right table._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
|
|
|
|
|