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
,      Maximum
,      Maximum - Minimum AS Range
FROM   (
    SELECT MIN(totalUsed) AS Minimum
    ,      MAX(totalUsed) AS Maximum
    FROM   quotes
)

Is this acceptable, or could there be unintended consequences? Is there a
better way to do it?

-- 
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to