i have a db like this:
Table1:
----------
id
id_item
tablename (enum: 'table2','table3','table4')
table2:
----------
id
value
table3:
-----------
id
value
table4: [...]
And i want a query similar like this:
SELECT t1.id, t2.value FROM table1 AS t1
LEFT JOIN t1.tablename as t2 ON t1.id_item=t2.id
i tried this "ERROR 1146 (42S02): Table 't1.table' doesn't exist"
please any one suggest a query similar to this or new formate i am reday to use
thanks in advance.