i have a multiple tables quiery using UNION option in mysql. I wanna know from which table come each row in the query result.
Any code to do that?
Thanks.
add an extra field at the end of the field list eg
select id, name, info, 'A' as sortorder from table1 union select id, name, info, 'B' as sortorder from table2
Do u mean add another field of the table fields list at the end?
And what's sortorder do?