On 19 Oct 2012, at 8:09pm, Steinar Midtskogen <stei...@latinitas.org> wrote:

> I have tables with a timestamp (unix time) and columns containing
> sensor readings which are inserted continuously.  I frequently need to
> access the most recent values (or NULL if there is no value within the
> latest, say, hour).  I would like to do something like:
> 
> SELECT coalesce(col_1), ..., coalesce(col_n)

Don't do this.  You are confusing a database with a spreadsheet.  Instead of a 
wide table make a thin table which has the above column number as a field.  You 
will find that this magically makes most of your programming problems go away.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to