Hi,

Thanks for your reply but that produces exactly the same result...

Any ideas?

From: Sasha Pachev <[EMAIL PROTECTED]>
To: shaun thornburgh <[EMAIL PROTECTED]>
CC: mysql@lists.mysql.com
Subject: Re: Help with a join query please!
Date: Tue, 21 Dec 2004 14:57:43 -0700

shaun thornburgh wrote:
Hi,

I have (among others) three tables in my database that i am struggling with a join query on. The database holds dates for Bookings. If Users are Allocated to a particular Project they can be booked. However if a user is booked but then unallocated I want to be able to display all peolple allocated to that project plus the person originally booked. Here are my efforts so far:

SELECT U.User_ID, U.User_Firstname, U.User_Lastname
FROM Allocations A, Users U
LEFT JOIN Bookings B
ON B.User_ID = U.User_ID
AND B.Booking_ID = '4512'
WHERE U.User_ID = A.User_ID
AND A.Project_ID = '11'
ORDER BY User_Firstname;

Shaun:

If I understand the problem right, it sounds like you are missing AND B.Bookings_ID is NULL in the where clause.



--
Sasha Pachev
Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]





-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to