| От | Steve Crawford |
|---|---|
| Тема | Re: SELECT WHERE NOT, is not working |
| Дата | |
| Msg-id | 200501051459.34598.scrawford@pinpointresearch.com обсуждение исходный текст |
| Ответ на | Re: SELECT WHERE NOT, is not working (MargaretGillon@chromalloy.com) |
| Список | pgsql-general |
On Wednesday 05 January 2005 2:51 pm, MargaretGillon@chromalloy.com wrote: > Thanks, Ragnar, > > You are right in what is happening. The code was supposed to be > sending '' but it is sending NULL instead. I see now -- in > PostgreSQL to look for any record without the 'X' I have to use a > combined condition because a NULL is not included in a != > statement. > > select count(*) from resource where reengine is NULL or NOT > (reengine = 'X') ; Or use the coalesce statement (picks the first non-null argument): select count(*) from resource where coalesce(reengine, '') != 'X'; Cheers, Steve
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера