Quote:
Originally Posted by Telos
Code:
select u.user_id from users u
|
You don't need to use the table alias until after you declare it.
Code:
select u.user_id from users u
would give you the same result as
Code:
select user_id from users u
but after you've declared a table alias you must use that in the rest of the query. In other words
Code:
select user_id from users u
order by u.user_id
would work, but
Code:
select user_id from users u
order by users.user_id
would give you a syntax error. (1109 - Unknown table 'users' in order clause)