>
> Use a CASE statement?
>
> something like:
> select  case WHEN os ~* E'^windows' then 'windows'
>   WHEN os ~* E'server' then 'server'
>   WHEN os ~* E'nix$' then '*nix'
>   else 'other' end
>   as osval, count(*) from os_tbl  group by osval order by osval;
>
> The hard part is making sure your regexes cover all the bases, without
> duplication.
>
> It still sounds like the value should be a reference to a unique value in a
> small table of operating system entries, then store the value, rather than
> the string, in the main table.
>
> Susan
>

I'll give this a shot. looks like it will work well. Regexes, I don't mind,
SQL, I'm new at. Much less the pg functions.
thanks to both you and bricklin.

Reply via email to