Skip to content

Instantly share code, notes, and snippets.

@Shadow6363
Created February 21, 2013 16:48
Show Gist options
  • Save Shadow6363/5006123 to your computer and use it in GitHub Desktop.
Save Shadow6363/5006123 to your computer and use it in GitHub Desktop.
SELECT
*,
@rowNum := @rowNum + 1 as row_number
FROM `datalog`
JOIN ( SELECT @rowNum := 0 )
WHERE
MOD(row_number, 4) = 0 AND
sensorid = '$sensor' AND
time >= '$timeOffset'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment