Re: Selecting Fields in Union in Subquery

Поиск
Список
Период
Сортировка
Искать
От
Bartosz Dmytrak
Тема
Re: Selecting Fields in Union in Subquery
Дата
Msg-id
CAD8_UcYdP6wHjkciNAh8ZSRVWF8d-n9hVEL8-G472qj94hkrkw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Selecting Fields in Union in Subquery Tom Burns <tramseyburns@yahoo.com>
Re: Selecting Fields in Union in Subquery Bartosz Dmytrak <bdmytrak@gmail.com>

2012/7/13 Tom Burns <tramseyburns@yahoo.com>

I can no figure out the syntax for directly addressing fields (for example 'order by StateProvence" or "order by gTo.geo_name" instead of order by 3)

This should work ("StateProvence" not gTo.geo_name), but You should remember to use " (quotation mark) when You use camel cased names. If not PG will treat fields names like written in small letters. 
You should do something like this:
order by "StateProvence"
not
order by StateProvence
 
I would like to be able to filter and sort the sub-query in the parent query.
I don't get it, I assume You would like to sort/filter sub-query result in parent query.  Then You should remember to use names of sub-query result columns i.e
gTo.geo_name is not visilbe, but geolist."StateProvence" is visible outside sub query

Regards,
Bartek
В списке pgsql-novice по дате отправления
От: Ioannis Anagnostopoulos
Дата:
Сообщение: Index slow down insertions...
От: Ioannis Anagnostopoulos
Дата:
FAQ