| От | Kaloyan Iliev Iliev |
|---|---|
| Тема | Problems with UNION ALL and ORDER BY |
| Дата | |
| Msg-id | 410E6376.1010404@faith.digsys.bg обсуждение |
| Ответы |
Re: Problems with UNION ALL and ORDER BY
Re: Problems with UNION ALL and ORDER BY |
| Список | pgsql-sql |
Dear friends...,I have the following problem: select ..... from .... where ....UNION ALL select ... from .... where .... ORDER BY field1 But the the order by doesn't work properly. It returns the rows of the first query ordered and then appends the rows of the second query ordered. But this is not what i expect. I expect the result of both queries to be orderd. So I try. SELECT TEMP.* FROM ( select ..... from .... where ....UNION ALL select ... from .... where .... ) TEMP ORDER BY TEMP.field1 But this also doesn't work. Any ideas.p
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера