I have two tables: items
and orders
items
--------------
id (int) | type_1 (int) | type_2 (int)|
orders
--------------
id (int) | transaction_type enum ('type_1', 'type_2')
Basically, I want to do the following:
select (select transaction_type from orders where id=1) from items;
So, the problem is that string
returned by select transaction_type from orders where id=1
, cannot be converted into column name.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…