Hello, I am new to SQL. I am currently using PostGres, but i think querying is pretty much the same?
I have the following tables:
common, cds, and position
cds inherits common
common and cds are linked by 'id'.
common has values start and stop.
I want to find all the 'position.target_pos' that lie within a cds region (the start and stop are obtained from common).
I have this query:
SELECT count(*) FROM common, cds, position WHERE cds.id = common.id AND position.target_pos > common.start AND position.target_pos < common.stop
however, this is returning me the value of over 1,000 which is impossible if my query is correct because there are only 800 entried in the position table. Therefor, i'm pretty sure my query is wrong, but i'm not sure where!!