Re: Auomatic numbering, replacing nulls and IF

Поиск
Список
Период
Сортировка
От Jean-Michel POURE
Тема Re: Auomatic numbering, replacing nulls and IF
Дата
Msg-id 200203201555.g2KFt292009534@www1.translationforge
обсуждение исходный текст
Ответ на Auomatic numbering, replacing nulls and IF  ("Pestilence" <me@work.com>)
Список pgsql-general
Le Jeudi 14 Mars 2002 21:52, Pestilence a écrit :
> 1) Is it possible to create an INT PRIMARY KEY column that automagically
> numbers itself? MS-SQL does this using the IDENTITY keyword.
Use serial type.

> 2) The ISNULL function in both Oracle and MS-SQL takes 2 numbers and
> returns the second if the first is null, otherwise it returns the first.
> ISNULL in Postgres seems to be something quite different. Before I go
> writing my own function to do it, is there one already?

See COALESCE and NULLIF at
http://www.postgresql.com/idocs/index.php?functions-conditional.html

> 3) How do I do 'IF this_sql THEN that_sql'? I keep getting:
> parse error at or near "IF"

CASE WHEN condition THEN result
         [WHEN ....]
          ELSE

Cheers,
Jean-Michel POURE

В списке pgsql-general по дате отправления:

Предыдущее
От: "Ian Harding"
Дата:
Сообщение: Re: SQL Server performing much better?!?!
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: Al Dev and Postgresql book