SELECT myfield, ; IIF(myfield = "AAA", STR(0), STR(RECNO())) AS group ; FROM mytable ; INTO CURSOR crsTemp SELECT myfield, COUNT(*) ; FROM crsTemp ; GROUP BY myfield, group>Not sorting perse, but grouping. Let's say there is only 1 field and it contains either AAA or BBB. I want to group/count only the AAA records, but not the BBB records. One resulting record for all AAA with a count, but a one-for-one match on the BBB's. I think your SQL would give me:
SELECT myfield, COUNT(*) ; >> FROM mytable; >> GROUP BY 1>>>How would I do the following?
>>>AAA >>>AAA >>>BBB >>>AAA >>>BBB >>>>>>Result Desired:
>>>AAA 3 >>>BBB 1 >>>BBB 1 >>>