Selecting two names from a table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a table called Bookings and a table called User. Bookings are created
and hold the User_ID of the User who created it (Booking.Booked_User) and
the User who will be going on the booking (Booking.Booking_Creator). How can
I create a report that lists both users on each row. If I do 'SELECT
U.User_Name, B.Booking_Date FROM WMS_User WHERE B.Booking_Creator =
U.User_ID AND B.Booked_User = U.User_ID', then the query returns no data. So
for each row in the table I need to somehow select 2 names from the user
table based on 2 different User_ID's held in the Bookings table. Any help
would be greatly appreciated.


Thanks for your help

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux