1: the diagrams ^^^up there, show what I'd like to do
2: I'm just a little frustrated that you can't SELECT * FROM (SELECT table_name FROM LinkTable WHERE LinkId = 12); <<this is what I "really" want to achieve..
with regards 2; it is possible, but the only way you can do it in mysql is by using a prepared statement as such:
Code: Select all
@tab = SELECT table_name FROM LinkTable WHERE LinkId = 12;
@quer = CONCAT('SELECT * FROM ',@tab);
PREPARE my_query FROM @quer;
EXECUTE my_query;
DEALLOCATE PREPARE my_query;