NJudson
02-22-2002, 10:27 AM
I have a query with 5 fields. One field is called ICID. There may be 100,000 records and I want a query that will display the TOP 25 ICID's that show up the most. I'm trying to write the query but I'm doing something wrong and can't get it to work. Here is my query without the Count function:
SELECT CELL109.ICID, CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
FROM CELL109
GROUP BY CELL109.ICID, CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
ORDER BY CELL109.ICID DESC;
How do I add the count function to get this to work. I've tried
SELECT CELL109.ICID, Count(CELL109.ICID) AS (CELL109.Number_of_Events), CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
FROM CELL109
GROUP BY CELL109.ICID, CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
ORDER BY Count(CELL109.Number_of_Events) DESC;
This does not work. I've looked through the archives and I see method I'm supposed to use but I still can't get it to work. I hope someone can help me here. Thanks.
SELECT CELL109.ICID, CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
FROM CELL109
GROUP BY CELL109.ICID, CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
ORDER BY CELL109.ICID DESC;
How do I add the count function to get this to work. I've tried
SELECT CELL109.ICID, Count(CELL109.ICID) AS (CELL109.Number_of_Events), CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
FROM CELL109
GROUP BY CELL109.ICID, CELL109.SWITCH, CELL109.TRBLCODE, CELL109.DATE, CELL109.TIME
ORDER BY Count(CELL109.Number_of_Events) DESC;
This does not work. I've looked through the archives and I see method I'm supposed to use but I still can't get it to work. I hope someone can help me here. Thanks.