MySQL Forums
Forum List  »  Newbie

Re: Just a question about simple inner join statement
Posted by: Felix Geerinckx
Date: August 09, 2005 01:02AM

Mike B wrote:

> INNER JOIN Biographies B ON B.UserID = U.UserID
>
> the things that i cant seem to find anywhere are the B, the B. and the U.

The B is a so-called table alias. It can also be written as (note the AS)

INNER JOIN Biographies AS B ON B.UserId = U.UserID

Sometimes it's only used as a shorthand for a table, but sometimes it is necessary when doing a self join or when joining the same table more than one time in the same query, e.g. as in

SELECT
P.name AS 'Employee',
M.name AS 'Manager'
FROM personel AS P
JOIN personel AS M ON M.id = P.manager_id;

Note that in the above query another type of alias is used: a column alias.

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: Just a question about simple inner join statement
August 09, 2005 01:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.