On 06/09/18 18:04, Simon Slavin wrote:
CREATE TABLE tempLog (
    datestamp TEXT COLLATE NOCASE PRIMARY KEY,
    centTemp REAL,
    fahrTemp AS (centTemp*9/5 + 32) )

I'm happy with another syntax as long as it does the same thing.

CREATE TABLE tempLog (
   datestamp TEXT COLLATE NOCASE PRIMARY KEY
 , centTemp  REAL);
CREATE VIEW tempLogView AS
     SELECT *
          , centTemp * 9 / 5 + 32 AS fahrTemp
       FROM tempLog;

Niggle 1: Can a computed column refer to a column defined after it ?

With the view syntax I showed above, "computed" columns can only refer
to columns that exist in the underlying tables.  I wish SELECT statement
expressions could refer not only to input columns but also output
columns that have been named using AS, but we don't have this feature.

--
Andy Goth | <andrew.m.goth/at/gmail/dot/com>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to