mySQL / .jsp query question

Homerboy

Lifer
Mar 1, 2000
30,859
4,976
126
Just having a brain fart here... and I can't muddle through it.

I want to do a query like the following:

ResultSet results = stmt.executeQuery("SELECT * FROM players p WHERE p.pos = 'WR' OR p.pos = 'QB' AND p.team ='" + teamid + "' ORDER BY " + sortField + " DESC");


Specifically the part in question is: WHERE p.pos = 'WR' OR p.pos = 'QB' AND p.team ='" + teamid + "'


I want it to return all, where the p.pos = QB or HB and the p.team = teamid (in URL)
everything works fine EXCEPT for the stupid mutliple position aspect of it... If I have just "WHERE p.pos = 'QB' AND p.team ='" + teamid + ... all is fine. But I cant define that I want QBs and WRs (and then in turn HBs, FBs etc etc)

Thanks in advance!

Does any of that make sense?