Re: generating json without nulls

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: generating json without nulls
Дата
Msg-id VisenaEmail.70.7125f92dc9db25c2.14d2ef26624@tc7-visena
обсуждение исходный текст
Ответ на generating json without nulls  (Tim Dudgeon <tdudgeon.ml@gmail.com>)
Ответы Re: generating json without nulls  (Tim Dudgeon <tdudgeon.ml@gmail.com>)
Список pgsql-sql
 På torsdag 07. mai 2015 kl. 12:56:42, skrev Tim Dudgeon <tdudgeon.ml@gmail.com>:
Hi All!
I'm using the postgres json functions to generate json for values in a
table.
Something like this:

SELECT row_to_json(a_table) FROM a_table

But my data has lots of null values and that results in json attributes
like this:

"colname":null

I want to exclude those values from the json and only include non-null
values.
Any idea how to best go about this?

Tim
 
WHERE colname IS NOT NULL ?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Вложения

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

Предыдущее
От: Tim Dudgeon
Дата:
Сообщение: generating json without nulls
Следующее
От: Tim Dudgeon
Дата:
Сообщение: Re: generating json without nulls