HI Don,
Try this:
SELECT U.* FROM `user` U LEFT OUTER JOIN vacation V ON
U.id=V.uid
Where V.uid is NULL
Thank you.
Ehsan
http://ehsan.bdwebwork.co
m/
On Jan 15, 6:56 am, "don.vo... gmail.com"
<don.vo... gmail.com> wrote:
> Hi To All,
>
> Would someone please help point me in the right
direction with the
> following problem. I have two tables, one called users
that stores all
> users for my group and another table called vacations
which stores
> which days someone is on vacation. Both have a field
called user_id
> (this is the key for the users table).
>
> What I am trying to do is to return a query from the
users table with
> everyone who is not in the vacation table. For
instance, all people
> from the users table minus the user_id's I find in the
vacations table.
>
> I am assuming I need to us a NOT IN and a subquery but
am having
> trouble getting what I need.
>
> Thanks in advance for any help or direction you can
provide.
>
> Sincerely,
>
> Don
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysql googlegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/phpmysql?hl=en
-~----------~----~----~----~------~----~------~--~---
|