I have a table lets say
Table1
t_id A B C
100 1 1 0
101 1 0 1
102 1 1 0
Now I have input parameter param0 based on which first I have to select column (lets say B) and then using t_id value(lets say 101) i will be selecting value of that selected column(which is 0).
I want to create single query as i will be using it in join query.
Is above possible, if yes how to write the sql for same?