4gl Question
Posted in 1994
I have an interesting 4gl question. I have a table which contains column a
and column b. I'm trying to get a count on unique column b using column a
as the search criteria.
DATA
a XX XX XX YY YY XX XX
b 11 22 11 22 33 33 44
XX I have 4 different column b(11, 22, 33, 44)
YY I have 2 different column b(22,33)
Without using a cursor, here is the solution i came up with (I don't
particularly care for my solution but it does work). I was wondering along
with Dave Snyder if there is a better way.
SELECT UNIQUE b
FROM table
WHERE table.a = "XX"
INTO TEMP temptable
LET the_count = SQLCA.SQLERRD[3] ### NUMBER OF ROWS PROCESSED
I'm interested in seeing a better way and I'd rather not use a view. We
are looking for a glamorous SQL statement.
trr
--
Ted Reph @ UE&C - Catalytic in Philadelphia, PA
INTERNET: trr@trac3000.ueci.com