onedumbcoder Posted November 20, 2008 Share Posted November 20, 2008 lets say i have select a from 1 union select a from 2 is there a way to tell what table a is coming from? Link to comment https://forums.phpfreaks.com/topic/133463-is-there-a-way-to-tell-from-what-table-the-elemnt-is-coming-from-in-a-union-quer/ Share on other sites More sharing options...
onedumbcoder Posted November 20, 2008 Author Share Posted November 20, 2008 for example when i am going through the list and printing out the values that have been returned is there any way to tell where that value came from whether it came from 1 or 2 Link to comment https://forums.phpfreaks.com/topic/133463-is-there-a-way-to-tell-from-what-table-the-elemnt-is-coming-from-in-a-union-quer/#findComment-694158 Share on other sites More sharing options...
Mark Baker Posted November 20, 2008 Share Posted November 20, 2008 SELECT 'table_1' as sourceTable column_a FROM table_1 UNION SELECT 'table_2' as sourceTable column_a FROM table_2 Link to comment https://forums.phpfreaks.com/topic/133463-is-there-a-way-to-tell-from-what-table-the-elemnt-is-coming-from-in-a-union-quer/#findComment-694178 Share on other sites More sharing options...
onedumbcoder Posted November 20, 2008 Author Share Posted November 20, 2008 wow thanks my friend!!!!!!! that helps me out so much Link to comment https://forums.phpfreaks.com/topic/133463-is-there-a-way-to-tell-from-what-table-the-elemnt-is-coming-from-in-a-union-quer/#findComment-694619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.