Hi all:
I have a table called 'specials' that has FKs to tables 'users' and 'resorts'. When writing the select statement, I want to select all fields from 'specials' but only "user_name" from 'users' and "resort_name" from 'resorts'. What would be the syntax for that? I tried this and it gave me a syntax error:
SELECT * FROM specials, user_name FROM users , resort_name FROM resorts WHERE specials.users_user_id = users.user_id AND specials.resorts_resort_id = resorts.resort_id
Thanks!
EDIT:
Ooops, braindead! This was it:
SELECT specials.*, users.user_name, resorts.resort_name FROM specials, users, resorts WHERE specials.users_user_id = users.user_id AND specials.resorts_resort_id = resorts.resort_id LIMIT 0, 30
🙂