I have two tables TABLE_A with columnname COLUMN1 COLUMN2 COLUMN3 COLUMN4 COLUMN5 and which has data
abc def ghi jkl mno
123 456 789 001 121
TABLE_B with columnname COLUMN6 COLUMN7 which has data as
COLUMN5 124
COLUMN4 bca
COLUMN3 aaa
COLUMN5 bbb
So I have the columnname of Table_A as a data in the table_B
so I want to do something like this in a single query
$query1= select COLUMN6 from TABLE_B where COLUMN7='aaa';
$query2= select $query1 from TABLE_A where COLUMN1='123';
Thanks