Alan,
 
I see what you want.
 
It looks like if you use an inner join that it might works right, but I would do some serious testing.  Try this:
 
select * from table1, table2 where table1.id = table2.id and count > 1 and count <= 10 order by some_col
 
Troy  
 
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Alan Wolfe
Sent: Monday, October 13, 2003 5:08 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: count with multiple tables

Hey Troy,
 
Im actualy looking for blocks of 10, like if the user requests page 2 i want count >10 and count <=20 to show the results 11-20.
 
if they request page 3 it would show count >20 and count <=30 to show results 21-30.
 
----- Original Message -----
Sent: Monday, October 13, 2003 3:55 PM
Subject: [RBASE-L] - RE: count with multiple tables

I think this would give you unpredictable results.
I think you might be looking for a group by and a having clause.
 
select table1.masterId, count (*) from table1 left join table2 on (....)
group by table1.masterID having count (*) <= 10
 
This would give you a list of masterid with 10 or fewer rows in table2.
 
Troy 
 
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Alan Wolfe
Sent: Monday, October 13, 2003 3:54 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - count with multiple tables

hello i was wondering about using count in selects that involve multiple tables.
 
if i have something like this:
 
select * from
table1 left join table2
on (clause here)
and count > 0
and count <= 10
 
which table does it get the count from?
 
is it table1, table2 or is it the number of results that it returns?
 
TIA,
Alan

Reply via email to