I've got a corker of a query that I'm trying to do. Not really sure whats the best way to go about this one but here's the description. I want to select the number of elements from table A where; the category field in table B = catx and has an id = idx which exists in table A as catid Table A id catid Table B id category
English to SQL: SELECT COUNT(*) FROM tablea a, tableb b WHERE b.category = 'catx' AND b.id = 'idx' AND a.catid = b.id Code (markup): should do the trick.