jimmyshoes
Programmer
I have a fruit table as follows
UserID Type
1 Orange
2 Apple
1 Pineapple
2 Kiwi
2 Pineapple
I am trying to create a query which for example returns the userid of anyone who has both an Orange AND a Pineapple (in this case User ID 1)
I have been experiementing with
select UserID from fruit
where type = 'Orange' and type = 'Pineapple'
but this yields no results
UserID Type
1 Orange
2 Apple
1 Pineapple
2 Kiwi
2 Pineapple
I am trying to create a query which for example returns the userid of anyone who has both an Orange AND a Pineapple (in this case User ID 1)
I have been experiementing with
select UserID from fruit
where type = 'Orange' and type = 'Pineapple'
but this yields no results