Skip to content

SQL queries

Aaron Morris edited this page Sep 22, 2021 · 25 revisions
  • Show number of seconds between each image and the last image for the last 24 hours.

      SELECT id,datetime(createDate, 'localtime'),strftime('%s', createDate) - LAG(strftime('%s', createDate)) OVER (ORDER BY createDate) AS date_diff FROM image WHERE createDate > datetime(datetime('now'), '-24 hours') ORDER BY createDate DESC;
    
Clone this wiki locally