sql statement that gives me entities that contanins 1.value AND 2.value from one column -


i table looks this:

column1|column2   1      |a   1      |b   1      |c   2      |a   3      |b   4      |a   4      |b   

...

what need write sql statetment entities column1 has values , b in column2. in case result be: 1,4

thx in advance help.

try this

select column1 your_table group column1 having  max(case when column2='a' 1 else 0 end)+ max(case when column2='b' 1 else 0 end)=2 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -