Re: [sqlite] Is this rewrite of a query OK

2019-01-25 Thread Jens Alfke
> On Jan 25, 2019, at 2:35 PM, Cecil Westerhof wrote: > > I had the following query: > SELECT MIN(totalUsed) AS minimum > , MAX(totalUsed) AS maximum > , MAX(totalUsed) - MIN(totalUsed) AS range > FROM quotes Couldn’t you do the subtraction in the

Re: [sqlite] Is this rewrite of a query OK

2019-01-25 Thread James K. Lowden
On Fri, 25 Jan 2019 23:35:51 +0100 Cecil Westerhof wrote: > SELECT MIN(totalUsed) AS minimum > , MAX(totalUsed) AS maximum > , MAX(totalUsed) - MIN(totalUsed) AS range > FROM quotes > > But I did not like it because I repeated the MIN and MAX. Ther

[sqlite] Is this rewrite of a query OK

2019-01-25 Thread Cecil Westerhof
I had the following query: SELECT MIN(totalUsed) AS minimum , MAX(totalUsed) AS maximum , MAX(totalUsed) - MIN(totalUsed) AS range FROM quotes But I did not like it because I repeated the MIN and MAX. So I rewrote it to the following: SELECT Minimum ,