----- Original Message ----- 
From: "shaun thornburgh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 16, 2004 2:02 PM
Subject: Help with a join query please


> 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;
>
> I hope this makes sense!
>
We could do a lot more for you if you mentioned a few things:
a) which version of MySQL you are using
b) whether the query works or not the way it stands
c) if it does work, what is wrong with the answer you are getting
d) if it doesn't work, what error message you are getting

And if you REALLY want to help us help you, you could provide definitions of
the tables and a few rows of typical data from each table to help us
visualize the problem better.

Rhino


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

Reply via email to