Jump to content

Is this possible...showing table record belongs to in a UNION


eludlow

Recommended Posts

I have a large data set that for various reasons is split over 12 tables, with identical structures.  I know this sounds slightly odd, but trust me, I have to manage the data this way :(

 

Anyway, I have a query that "UNIONS" certain records from each table into one view, which all works fine.

 

However, is it possible, when querying the database, to find out which table each record belongs to?

 

So I have, let's say, 12 rows in my view, one from each table and I want to not only extract the data from each column of each row, but the "originating" table the data is in?

 

I can do this by searching each table it MAY be in, but that seems a bit long winded.

 

Many thanks,

Ed Ludlow

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.