Re: PreparedStatement vs. Statement problem

Поиск
Список
Период
Сортировка
От tivvpgsqljdbc@gtech-ua.com
Тема Re: PreparedStatement vs. Statement problem
Дата
Msg-id 474E9208.8040605@gtech-ua.com
обсуждение исходный текст
Ответ на Re: PreparedStatement vs. Statement problem  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Oliver Jowett wrote:
> yoursoft wrote:
>> Ok, the planner uses different way. I think the planner use the UNION
>> in PreparedStatement and not the UNION ALL?
>> How to rewrite the SQL to use the UNION ALL in preparedstatement?
>
> You need an ORDER BY or the order is undefined and unpredictable. See
> http://www.postgresql.org/docs/8.2/static/queries-order.html
>
> There's no simple way to say "give me rows from this table first"
> other than running a query on each table separately.

Actually the simple way is
select c1,c2,c3,...,cn from (select 1, table1.* from table1 union all
select 2, table2.* from table2 union all ...) a(ordercolumn, c1, c2, c3,
.., cn) order by 1





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

Предыдущее
От: "Donald Fraser"
Дата:
Сообщение: Re: ssl connection and webstart
Следующее
От: "Christian Rengstl"
Дата:
Сообщение: Serial data type