Re: Handling (None,) Query Results

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Handling (None,) Query Results
Дата
Msg-id 63e5c526-7e07-ad4b-f891-ac5272257507@aklaver.com
обсуждение исходный текст
Ответ на RE: Handling (None,) Query Results  (<hagen@datasundae.com>)
Список psycopg
On 12/5/20 8:14 AM, hagen@datasundae.com wrote:
> I tried  the COALESCE approach but I thought the query still returned (None,).

 From docs:

https://www.postgresql.org/docs/12/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL

"The COALESCE function returns the first of its arguments that is not 
null. Null is returned only if all arguments are null. ..."

So if it returned NULL/None then the first and second values both 
resolved to NULL.

> 
> However, I just tried it again and I got a (Decimal('0'),) return.
> 
> I should be able to make that work.
> 
> Thanks everyone for your rapid assistance.
> 
> Best,
> 
> Hagen
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От:
Дата:
Сообщение: RE: Handling (None,) Query Results
Следующее
От:
Дата:
Сообщение: Inserting variable into