I have two tables with some unique and some duplicate entries. I need to UNION those tables and output an additional column, that concatenates a tableidentifier the row was found in. Please find an example here: http://sqlfiddle.com/#!18/dc20c/6/0
My Output should look like this:
tablename || Column1 || Column2
AB Foo Bar
A Donut Onions
B Donut Pickles
Sadly just adding a column to union will make the rows unique and thus not be merged or concatenated. How do I achieve this?