postgresql - SQL UNION Question -
can explain me why sql statement:
select 'test1' union select 'test2' union select 'test3'
returns:
test2 test3 test1
i trying figure out logic behind union
keyword in aspect. there way return:
test1 test2 test3
without using order by
clause? in other words, can control execution order of union
statements?
if matters, using postgre 9.0 , php language
many thanks, brett
according postgresql docs union:
union appends result of query2 result of query1 (although there no guarantee order in rows returned).
Comments
Post a Comment