IFNULL -> COALESCE

Поиск
Список
Период
Сортировка
От Lee Kindness
Тема IFNULL -> COALESCE
Дата
Msg-id 15459.65199.280887.269425@kelvin.csl.co.uk
обсуждение исходный текст
Ответы Re: IFNULL -> COALESCE  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
Guys, I've recently being going back over code from Ingres and porting
it over to PostgreSQL. Heavy use was made of the IFNULL function, this
function simply returns the 2nd argument if the first is
NULL. Consider the following query:
SELECT COALESCE(MAX(id), 0) + 1 from test;

can be replaced by the following PostgreSQL query:
SELECT COALESCE(MAX(id), 0) + 1 from test;

I've manually done this, but wouldn't this be a useful auto-tranlation
to make in the parser? Aid to porting and all...

Yeah, I know i should be using a SERIAL column, that's later work...

Regards, Lee.


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: PostgreSQL 7.2 on SlashDot
Следующее
От: Vince Vielhaber
Дата:
Сообщение: Re: PostgreSQL 7.2 on SlashDot