From: Peter Brawley Date: May 17 2007 4:00pm Subject: Re: Select question List-Archive: http://lists.mysql.com/mysql/206841 Message-Id: <464C7C21.7030706@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Erich, >Is there a way to set a prefix for each table so that >the results come out like tablename.column? Use a scripting or application language to automate & parameterise query generation. SQL is just a partial computing language. PB ----- Erich C. Beyrent wrote: > I have three tables, all of which have a 'name' column. > > If I do: > > select table1.*, table2.*, table3.* from .... > > I'll end up with a result set that has three 'name' fields, but no way > to distinguish which table the field belongs to. > > I know I can select individual columns like: > > select table1.name as foo, table2.name as bar ... > > but I need all the columns from each table and that will be very > tedious. Is there a way to set a prefix for each table so that the > results come out like tablename.column? > > -Erich- >