I have a table with the following fields:
gender (male/female)
race (human/orc)
class (hunter/rogue/warrior)
Str
Int
Wil
Dex
Con
Statsum
str, int, wil, dex, con and sum are all numbers.
What I want my query to get hold of is all homelands where at least one of the entries has a str above 16, at least one entry has a dex above 17 and at least one entry that has a con above 15.
I started off with this:
SELECT DISTINCT homeland FROM Stats
WHERE gender = 'male' AND race = 'human' AND statclass = 'hunter' AND (str >= '16' OR dex >= '17' OR con >= '15');
But this of course gives me any homeland that has EITHER high enough str dex or con - how do I get only those who have at least one entry with the wanted number or higher?
Thanks!
Anumet
gender (male/female)
race (human/orc)
class (hunter/rogue/warrior)
Str
Int
Wil
Dex
Con
Statsum
str, int, wil, dex, con and sum are all numbers.
What I want my query to get hold of is all homelands where at least one of the entries has a str above 16, at least one entry has a dex above 17 and at least one entry that has a con above 15.
I started off with this:
SELECT DISTINCT homeland FROM Stats
WHERE gender = 'male' AND race = 'human' AND statclass = 'hunter' AND (str >= '16' OR dex >= '17' OR con >= '15');
But this of course gives me any homeland that has EITHER high enough str dex or con - how do I get only those who have at least one entry with the wanted number or higher?
Thanks!
Anumet