Auomatic numbering, replacing nulls and IF

Поиск
Список
Период
Сортировка
От Pestilence
Тема Auomatic numbering, replacing nulls and IF
Дата
Msg-id 3c910d7d$1@news.nz.asiaonline.net
обсуждение исходный текст
Ответы Re: Auomatic numbering, replacing nulls and IF  (Jean-Michel POURE <jm.poure@freesurf.fr>)
Re: Auomatic numbering, replacing nulls and IF  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
I'm a child of Oracle and MS-SQL (forgive me) and have only been playing
with Postgres for a few days. I have 3 questions that I couldn't find
answers for in the online docs:

1) Is it possible to create an INT PRIMARY KEY column that automagically
numbers itself? MS-SQL does this using the IDENTITY keyword.

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?

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

================================
Luke Pascoe
Senior Developer
IT Support & Development Limited
http://wwwitsd.co.nz
Mobile: (021) 303019
Email: luke@itsd.co.nz
================================



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

Предыдущее
От: "Pestilence"
Дата:
Сообщение: Re: Auomatic numbering, replacing nulls and IF
Следующее
От: Orion Henry
Дата:
Сообщение: Questions with the planner