>Hello Fellow Developers
> I have a question about a select statement that I am creating. I am trying to grab the top 10 records that meat a certian type of criteria in a database. I know about the cnt command but every time I use this I get a single record with my table count. I was wondering if this was possible to do in a select statement or if I have to select disting and the scan through and count ?
>
>Please help with suggestions
>
Hi Darren In Atlanta,
You can include the CNT() function in the select statement such as:
SELECT *, CNT(*) AS Num;
FROM Mytable;
GROUP BY Fieldname;
INTO CURSOR Foo
The Num field will contain the number of records that are in each group.
hth,
George
Ubi caritas et amor, deus ibi est