Matthew Halliday wrote:
> Unfortunately is comlains after "SET diff_used," and I get "near ",":
> syntax error: "

Then your SQLite is too old; row values require 3.15 or later.

> it won't diferentiate between servers and drives.

Oops!

> However this does appear to have worked!  Seems a bit long-winded to me but
> it worked.
>
> UPDATE tmp_dspace_import
> SET diff_used = (SELECT tmp_dspace_import.used_mb - ifnull(prev.used_mb, 0)
> FROM tmp_dspace_import AS prev  WHERE tmp_dspace_import.servername =
> prev.servername AND tmp_dspace_import.drive = prev.drive AND prev.date_time
> < tmp_dspace_import.date_time ORDER BY date_time DESC LIMIT 1),
> [...]

With the three-column subquery, it wouldn't be long winded.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to