this should be easy, but it's not :(
I have a table with a bunch of different feature Ids.
What I need is to build a way to say:
"show me all pet stores that have puppies, kittens, mice, or fish" (at least one)
That's the easy part.
What I'm stuck at is...
"show me all pet stores that have puppies for sure, but maybe also kittens, mice or fish"
Any ideas? :)
Thanks guys!
Edit:
I posted this question on another site, but didn't get an answer, I'll post it here. This is my original question, please consider the above also:
+------------------+----------+---------+
¦ Column1 ¦ Column2 ¦ Active ¦
+------------------+----------+---------+
¦ blue widgets ¦ 14 ¦ y ¦
¦ red ¦ 14 ¦ y ¦
¦ redx ¦ 15 ¦ y ¦
¦ blues ¦ 14 ¦ y ¦
¦ blue ¦ 15 ¦ n ¦
¦ bluesX ¦ 15 ¦ n ¦
¦ widgets ¦ 14 ¦ n ¦
+------------------+----------+---------+
Here is my drama... I need to query this:
where (Column2 = 14 AND Column2 = 15) and active = 'y'
I a result set that has all records where there is active = 'y' for both Column2=14 and Column2=15
I can't figure this out...
I can do it so it returns me 14 and 15 with at least one of them as y, but not both.
I tried:
select * from table where (Column2 = 14 and Column2 = 15) and active = 'y'
Of course, this returns nothing, since both can't be 14 and 15 at the same time.
So I tried:
select * from table where ((Column2 = 14 or Column2 = 15) and active = 'y')
And this returns a result set, but not what I want...
I need to only return results in column1 that have:
column2 = 14 and active = 'y' column2 = 15 and active = 'y'
both conditions must be true.
Any help? thanks guys!