Page 1 of 1

Modified fieldnames in query result

Posted: 01.02.2008, 18:51
by Choppers
I'm running a SELECT query, over several tables. Each table has a field called 'last_updated'. When i browse the results of the query, the field have been renamed :

last_updated_1
last_updated_2
last_updated_3

Can anyone suggest an easy way to tell which field is from which table ?

Posted: 01.02.2008, 19:04
by gto
select
table_1.last_updated as last_updated_tbl1
table_2.last_updated as last_updated_tbl2
table_3.last_updated as last_updated_tbl3
from table_1, table_2, table_3


The "AS" directive change the name of field in resultset.

Posted: 01.02.2008, 22:00
by Choppers
Thanks gto, that'll do nicely.

I was hoping the tzquery component might hold the info somewhere, but i guess i'm probably just being lazy.

Thanks.