| От | Michael Paesold |
|---|---|
| Тема | Re: Problem with select and null |
| Дата | |
| Msg-id | 012601c48eaa$f53ee1e0$ad01a8c0@zaphod обсуждение исходный текст |
| Ответ на | Problem with select and null ("Frank Millman" <frank@chagford.com>) |
| Список | pgsql-general |
Frank Millman wrote: > Hi all > > 'SELECT (null * null)' returns null > > 'SELECT (null - 0)' returns null > > 'SELECT ((null * null) - 0)' gives the following error - > ERROR: operator does not exist: "char" - integer > > Why does this statement give an error? I would expect it to return null. This does not seem to be a bug from my point of view. Postgres just doesn't know what datatype these nulls should be. You can cast the null values to integer (or float if you need): SELECT ((null::integer * null::integer) - 0); -- returns null Best Regards, Michael Paesold
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера