Q&A about the site for Drupal developers and administrators
WITH sev AS (SELECT Row_number() OVER ( ORDER BY id) rn, userid, creationdate, suggestededitid, votetypeid FROM suggestededitvotes sev WHERE userid = ##TheUserid:int##) SELECT s_prev.rn, sev.userid, s_prev.creationdate, sev.creationdate, Datediff(ss, s_prev.creationdate, sev.creationdate) delta, 'http://stackoverflow.com/suggested-edits/' + Cast(sev.suggestededitid AS VARCHAR) suggestededitLink, vt.name VoteType FROM sev INNER JOIN sev s_prev ON sev.rn = s_prev.rn + 1 INNER JOIN votetypes vt ON sev.votetypeid = vt.id WHERE Cast(s_prev.creationdate AS DATE) = ##editday:string## ORDER BY sev.rn