UNION & LIMIT & ORDER BY - Mailing list pgsql-sql

From Emmanuel Engelhart
Subject UNION & LIMIT & ORDER BY
Date
Msg-id 20030614190127.51910c98.emmanuel@engelhart.org
Whole thread Raw
Responses Re: UNION & LIMIT & ORDER BY
List pgsql-sql
Hi

Why this query doesn't work ?

<<
SELECT  '1' AS id 
FROM  users
ORDER BY id
LIMIT 1
UNION
SELECT  '2' AS id 
FROM  users
>>

And this one work ?

<<
SELECT  '1' AS id 
FROM  users
UNION
SELECT  '2' AS id 
FROM  users
ORDER BY id
LIMIT 1
>>

-- 
-------------------------------------------------------------------------
| Dans le cours d'un long gouvernement, on va au mal par une pente      |
| insensible, et ne remonte au bien que par un effort.                  |
|                       Montesquieu, "de l'esprit des lois" livre V/VII |
-------------------------------------------------------------------------
Emmanuel Engelhart alias Kelson | ICQ UIN : 53388731 | TEL 01.58.46.04.79


pgsql-sql by date:

Previous
From: javier garcia - CEBAS
Date:
Subject: "No such attribute or function 'oid'"
Next
From: "Julian Scarfe"
Date:
Subject: Re: Ordering in an aggregate -- points to paths