eludlow Posted May 25, 2010 Share Posted May 25, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/202840-is-this-possibleshowing-table-record-belongs-to-in-a-union/ Share on other sites More sharing options...
eludlow Posted May 25, 2010 Author Share Posted May 25, 2010 PS mySQL version 5.0.90-community Quote Link to comment https://forums.phpfreaks.com/topic/202840-is-this-possibleshowing-table-record-belongs-to-in-a-union/#findComment-1063080 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.