If I have a MySQL query that contains a union, is there a way to add a custom field to each record in my result set that identifies which query that record is a result of?
So if my result set was generated from the records returned by two queries merged together by a union, the last field of each record row would be ‘type’ and either have a value of ‘query1’ or ‘query2’.
Thanks.
Looking for something like this?