Re: weird(to me) request

From: Adam Wieckowski <adam-wieckowski(at)tlen(dot)pl>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: weird(to me) request
Date: 2003-09-25 18:59:25
Message-ID: 3F733B0D.5050801@tlen.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Użytkownik Larry Rosenman napisał:

> I have the following rows (in addition to others):
>
> acct_num text,
> master_acct_num text,
>
>
> These are in the same table.
>
> What I want to enforce is that if the master_acct_num field is NOT
> NULL (it can be NULL, and
> that's fine), that the value appears in some row as acct_num.
> acct_num has a unique index on it, so that's fine.
>
> I'm not sure how to do this....
>
> Thanks!
>
> LER
>
>
select
case
when master_acct_num is null
then acct_num
else master_acct_num
end
from table;

did you mained somethink like this ?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Larry Rosenman 2003-09-25 19:02:04 Re: weird(to me) request
Previous Message Larry Rosenman 2003-09-25 18:51:28 weird(to me) request