Subject | aggregate query help |
---|---|
Author | kaczy27 |
Post date | 2004-10-22T15:13:55Z |
Hi,
I need some help with a query.
I have a storedporce that return smth like that
col1, col2, col3
11, aaa, BBB
12, aaa, CCC
13, bbb, DDD
I want to reduce this set to
col1, col2, col3
11, aaa, BBB
13, bbb, DDD
it seems like a simple grouping
but I can't find any function to aggregate. Would it be numbers I'd
use max() or sum(), but since this are text I am at loss.
I don't care which one of the (11 or 12) go into the set.
I'd use first(colname) in MySQL or Access, but alas its not here.
Any ideas, or should I just go ahead and build a stored proc where I
would pass this set ordered by col2 and skip the suspend on nochange?
CUIN Kaczy
I need some help with a query.
I have a storedporce that return smth like that
col1, col2, col3
11, aaa, BBB
12, aaa, CCC
13, bbb, DDD
I want to reduce this set to
col1, col2, col3
11, aaa, BBB
13, bbb, DDD
it seems like a simple grouping
but I can't find any function to aggregate. Would it be numbers I'd
use max() or sum(), but since this are text I am at loss.
I don't care which one of the (11 or 12) go into the set.
I'd use first(colname) in MySQL or Access, but alas its not here.
Any ideas, or should I just go ahead and build a stored proc where I
would pass this set ordered by col2 and skip the suspend on nochange?
CUIN Kaczy