From: Rik Wasmus Date: August 3 2011 10:46am Subject: Re: Too many aliases List-Archive: http://lists.mysql.com/mysql/225480 Message-Id: <201108031246.39913.rik@grib.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > >>>> 2011/08/02 12:11 +0530, Adarsh Sharma >>>> > > select p.* from table A p, B q where p.id=q.id > > or > > select p.* from table B q , A p where q.id=p.id > <<<<<<<< > Why do people constantly change table names for queries, although, as here, > it gain them nothing? It often makes for less clarity (for which table is > this an alias???). Depens on your table names. I rather like being able to give a short description rather then long table names if someone decided that as a tablename. I doubt your example with already short tablenames is one from real life, but if you saw someone doing it would indeed be a waste of time. But the main thing is it helps to distinguish tables in joins having the same table more then once (and of course results from subqueries etc.): SELECT first.* FROM tablename first LEFT JOIN tablename second ON first.some_id = second.some_id AND first.id != second.id WHERE second.id IS NULL -- Rik Wasmus