私は2つのテーブルを持っていますitems
:orders
items
--------------
id (int) | type_1 (int) | type_2 (int)|
orders
--------------
id (int) | transaction_type enum ('type_1', 'type_2')
基本的に、私は次のことをしたいです:
select (select transaction_type from orders where id=1) from items;
したがって、問題は、string
によって返されるselect transaction_type from orders where id=1
、列名に変換できないことです。