Re: SQL query
Posted in 1998
Topics: SQL Development & Query Writing, Migration, Import/Export & Data Conversion
Hamish:
From what you've described and your sample data, it looks like you just
want the unique values in ascending order.
Here's one method:
select unique column1
from table1
order by column1;
You can also use a "group by" clause, which is useful for aggregate
functions in your select statements. Hope this helps you out.
-- Richard
At 14:25 6/8/98 GMT, Hamish McGregor wrote:
>Hello everyone,
>
>I have a simple table containing just one column.
>Example test data unloaded to ascii file could be:
>
>001,001,002,002,002,003,004,005,006,006,007,007,007
>
>What I want to do is issue a select statement that groups together the
>005, 006 and 007 as one such that I get the following output:
>
>001,002, 003, 004, 999
>
>where 999 represents the others.
>
>I don't fancy a bunch of selects UNIONed togther as the big scale
>version of this would mean having a whopping select statment.
>
>Any help given would be welcome.
>
>Thanks, Hamish.
>
>
--
Richard Caldera
SKECHERS USA, Inc.
MIS Department
richardc@skechers.com
(310) 318-3100 x 1228