May I ask on how do we execute Dynamic Select Query?
Basically what I want to achieve is a dynamic select that can SELECT a query based on a dynamic column, and that dynamic column is existing in a table.
Example Table
Table Name: AppleBox
Table Columns: Apple101, Apple102, Apple103
Table Row:
Apple101 = 1,2,3,4,5
Apple102 = 1,2,
Apple103 = 1
Supposed that I would run a query based on the example
SELECT apple+'$applecode' FROM AppleBox
with $applecode being from an external source, and $applecode = 101, and my expected query would be.
SELECT apple101 FROM AppleBox
Is there a simple way to do this?