ColA ColB ColC ColD
data1 rata1 T Test1
data1 rata3 F Test2
data1 rata2 T Test1
data2 rata1 T Test1
data2 rata3 T Test1
data3 rata4 T Test1
Have four columns of type Varchar. What i wish to determine is:-
1. For each unique value of ColB(rata1, rata2 etc), find corresponding value of ColA and other two columns (ColC, ColD) where that specific value of ColA has ColC value equal to ‘T’ 0 or 1 times.
rata2 data1 T Test1
rata3 data2 T Test1
rata4 data3 T Test1
2. In the above query when ColC was equal to ‘T’ 0 or 1 times, find other rows for which ColA has ColC equal to ‘F’ for that specific value of ColB.
rata3 data1 F Test2
Didn’t understand your question at all. I’ll correct the answer if you say something else. but as far I understood you want something like this?
Edit: I made the same table that you gave us in a DB. And this worked fine. Try it and tell me if it works
Edit 2: What about this?