[eluser]xarazar[/eluser]
Hi all,
I've just stumbled upon a query I need to form but as ridiculous as it sounds I really can't crack it. For test purposes I simplified my table so now it consists of only 2 fields: id and value with the following entries:
id - value
1 - 2
1 - 3
1 - 4
2 - 2
3 - 3
So if I want to get id's with, say, value 3 selected - no brainer
SELECT * FROM table WHERE val = 3 (returns 1 & 3)
But what I need is to get those id's with two or more values associated with them.
So for instance I need to query the database to return the id which has BOTH 2 and 3 associated with it. In our case it would be id = 1.
I'm sure there must be a simple answer to that but I must be having a senior moment...
Many thanks for any hint.