field - MySQL : How to know which table that record belongs to in UNION result -


lets want records 2 table using union. how add field each record tell me table belongs to? :

id     |    title     | link            | table ----------------------------------------------------- 1      | title 1      | somelink.html   | articles1 2      | title 2      | link2   .html   | articles2 3      | title 3      | link3   .html   | articles1 

thanks in advance?

select some_column, 'union_1' from_where table1 union  select some_column, 'union_2' from_where table2 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -