Subject | Query options ? |
---|---|
Author | kiki446@yahoo.com |
Post date | 2001-03-22T08:22:17Z |
Dear friends ,
one question related to INTERBASE SQL :
Let's say there are two tables - PEOPLE and PAYMENT
If I would like to count payments from table PAYMENT for people born
between
1960 and 1970 what should be the best way in SQL to do it ?
I have resolve it like :
select people_id,count(*) from payement
where people_id in
(select people_id from people where born between '01.01.1960' and
'31.12.1970' )
group by people_id
but don't know is this the best way .
Goran
one question related to INTERBASE SQL :
Let's say there are two tables - PEOPLE and PAYMENT
If I would like to count payments from table PAYMENT for people born
between
1960 and 1970 what should be the best way in SQL to do it ?
I have resolve it like :
select people_id,count(*) from payement
where people_id in
(select people_id from people where born between '01.01.1960' and
'31.12.1970' )
group by people_id
but don't know is this the best way .
Goran