Re: Query Advice

Поиск
Список
Период
Сортировка
От Gary Chambers
Тема Re: Query Advice
Дата
Msg-id alpine.DEB.2.20.1703301505350.17355@websrv.gogca.com
обсуждение исходный текст
Ответ на Re: Query Advice  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-sql
Gentlemen,

Thank you for your replies.

I'm working on a Python Flask web application.

> To comment as to "better" without any knowledge of the "application layer"
> doesn't make sense.  I suggest you provide an example of what you'd like
> the output to look like independent of any query concerns.

"Better" is to have the results returned without having the address columns
delimited by some character.  The simple join that Jason suggested is
definitely sufficient, but it seems like returning the repeating name column
is unnecessary.

My question is really more theoretical than anything else.  Vincent's
suggestion to return JSON is probably the closest to what I am trying to
accomplish.  My ultimate goal is to have the equivalent of a Python list of
dictionaries as addresses, though the keys aren't a requirement as long as I
can define the order of the columns and avoid using the delimiter.

That being said, how would I accomplish this and return the data in the
usual SQL results format without using concat_ws()?

Thank you, again, for your advice.

--
G.



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

Предыдущее
От: Jason Aleski
Дата:
Сообщение: Re: Query Advice
Следующее
От: Gary Chambers
Дата:
Сообщение: Re: Query Advice