Jump to content

Find underlying table name from view


eludlow

Recommended Posts

Hi all.

 

I've a table that UNIONs 12 tables together.  I then have a query (call it x) that will identify one row in this view (so it could be in one of 12 tables).  I then need to update one field in that one row.

 

I can't update the view, as it contains UNION.

 

Is there a way I can get mysql to tell me the name of the table that contains a row of data from the view?

 

This will make the update query a lot simple.  Otherwise, I will have to search EACH of the 12 tables for the row returned by my first query (x) and then update based on the table returned by that.

 

Thanks,

Ed

Link to comment
https://forums.phpfreaks.com/topic/222290-find-underlying-table-name-from-view/
Share on other sites

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.