I’m a complete sql noob, so I apologize for the sql butchering that follows…
Here’s the pseudocode for what I’m trying to do:
count(
join(
select( * from table X where a='stuff' and b='junk' ) as X1
select( * from table X where a='arg' and b='blarg' ) as X2
select( * from table X where a='narf' and b='foo' ) as X3
) where X1.c = X2.c = X3.c
)
Is it possible to get this result in one query?
If I were to guess what you really want, it is the count of “c”s which have all three of the conditions in the
aandbcolumns. If this is the case, the following works: