Re: Outer Joining Multiple Tables

This is a discussion on Re: Outer Joining Multiple Tables within the MySQL Database forums, part of the Database Forums category; On Jan 8, 3:37 am, "Paul Lautman" <paul.laut...@btinternet.com> wrote: > DonO wrote: &...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-09-2008
DonO
 
Posts: n/a
Default Re: Outer Joining Multiple Tables

On Jan 8, 3:37 am, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
> DonO wrote:
> > Ok. I'll try to explain better...

>
> > This will work to get everyone who is in the system:

>
> > SELECT signoff.item_name, user.first_name, user.last_name,
> > completed.date_complete
> > FROM signoff
> > JOIN completed ON completed.signoff_uid = signoff.uid
> > JOIN user ON user.uid = complete.user_uid
> > WHERE signoff.uid = '1' ;

>
> > That gets me the name off the required signoff, the user's name, and
> > the date they signed off.

>
> > I'd like to list all the employee's that have not signed off too with
> > a NULL for the date_complete.

>
> > Thanks,
> > D.

>
> Please do not top post.
>
> Can you supply some context for these tables?
> What is signoff.item_name?
> What is the significance of signoff.uid = '1'?
> If the above query gets "everyone who is in the system", how can there be
> more employees (note no apostrophe) to get?


Sorry about the top post. I was able to figure it out. You helped by
slapping my hand on how I did the joins ;-)

The "real" tables I have set up are EMPLOYEE, ACKNOWLEDGEMENT, and
EMPLOYEE_ACKNOWLEDGEMENT. The purpose of the system is to set up a
policy employees must sign off on. Not everyone has to sign off on
every policy though.

What I ended up doing is selecting all employee's, then left outer
joining the EMPLOYEE_ACKNOWLEDGEMENT table, and then a regular join to
ACKNOWLEDGEMENT table.

It lists all employees, and if they are set up, it will show the
status. If not, then I have the option to select a checkbox and submit
the list of IDs to add.

Anyhow... I appreciate you trying to help. It enabled me to figure it
out quicker!
D.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0