I agree. I use the same column name in all tables where it has the same
function - but I consistently add a suffix or prefix. And yes, it is the
old fashion way.... David.

-----Original Message-----
From: h...@tbbs.net [mailto:h...@tbbs.net] 
Sent: Thursday, August 04, 2011 8:26 AM
To: r...@grib.nl
Cc: mysql@lists.mysql.com
Subject: Re: Too many aliases

>>>> 2011/08/03 12:46 +0200, Rik Wasmus >>>>
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 
<<<<<<<<
Well, yes, here it is needful. But it seems to me from most of the
examples that people here post, that they have the idea that it is the
style always to use one-letter aliases, whether it is helpful or not.

Now I do not do this, but I often see examples where a field for one
purpose has in one table one name, and in another table another,
slightly different, name, and then, too, I see alias used, although, in
this case, no table name at all is needed. (I like to use the same field
name in all tables where it has the same function.)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=dle...@us.univision.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to