Skip to content
Advertisement

how to choose value in 1 column that must have 2 values in another – sql?

table:

the id 11 has both taught in classroom 11A, 11B. How to select the ids that have both values 11a,11b?

I tried this with no luck:

because it gives empty table, because it can’t be both 11a and b at the same time.

Advertisement

Answer

If it’s exectly two values you can make an inner join

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement