I am trying to create a temp-table and then insert into it a field and the count of all fields with that same value. I was hoping to do that with an insert into statement. Here is some sample code to try to give the idea. When I try to do this I get the error that temp_table does not exist or is not accesible. I was wondering if anyone else here has ever done this. If not I know of another way using for each/break by and first-of and last-of functions.
DEF TEMP-TABLE temp_table
FIELD l-field AS DEC
FIELD l-count AS INT.
INSERT INTO temp_table (l-field, l-count)
SELECT field, count(*)
FROM actual_table
GROUP BY field
HAVING(count(*) > 1).
DEF TEMP-TABLE temp_table
FIELD l-field AS DEC
FIELD l-count AS INT.
INSERT INTO temp_table (l-field, l-count)
SELECT field, count(*)
FROM actual_table
GROUP BY field
HAVING(count(*) > 1).