Re: [sqlite] Documentation of valid ORDER BY terms after UNION?

2017-05-15 Thread David Raymond
15, 2017 4:31 PM To: SQLite mailing list Subject: [sqlite] Documentation of valid ORDER BY terms after UNION? I've read "The ORDER BY clause" of [1] and I *think* that the following is what I am running into: "However, if the SELECT is a compound SELECT, then ORDER BY expr

Re: [sqlite] Documentation of valid ORDER BY terms after UNION?

2017-05-15 Thread nomad
On Mon May 15, 2017 at 09:58:31PM +0100, Simon Slavin wrote: > > On 15 May 2017, at 9:30pm, no...@null.net wrote: > > >SELECT > >1 AS col > >UNION ALL > >SELECT > >0 AS col > >ORDER BY > >col > 0 DESC; > > Out of interest, intuitively rather than reading

Re: [sqlite] Documentation of valid ORDER BY terms after UNION?

2017-05-15 Thread Simon Slavin
On 15 May 2017, at 9:30pm, no...@null.net wrote: >SELECT >1 AS col >UNION ALL >SELECT >0 AS col >ORDER BY >col > 0 DESC; Out of interest, intuitively rather than reading documentation, which do you think should be done first ? Should SQL do both SELECTs

[sqlite] Documentation of valid ORDER BY terms after UNION?

2017-05-15 Thread nomad
This works: SELECT 1 AS col ORDER BY col > 0 DESC; The following fails with "Error: 1st ORDER BY term does not match any column in the result set." SELECT 1 AS col UNION ALL SELECT 0 AS col ORDER BY col > 0 DESC; I've read "The