sql - Is there a way to display the table orgin for rows in a union -


when union n amount of tables there way add column result set says table row came from?

sure - add hard coded text column each statement.

select 'this came table a' sourcetable, id, name   tablea -- union -- select 'this came table b' sourcetable, id, name   tableb 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -