Skip to content

Instantly share code, notes, and snippets.

@jbouse
Created July 6, 2011 23:43
Show Gist options
  • Save jbouse/1068614 to your computer and use it in GitHub Desktop.
Save jbouse/1068614 to your computer and use it in GitHub Desktop.
pool.shares queries
SELECT username as address,
((COUNT(*) * POW(2,32))/900) as hashrate
FROM shares
WHERE our_result <> 'N'
AND UNIX_TIMESTAMP(time) BETWEEN (UNIX_TIMESTAMP(NOW())-900)
AND UNIX_TIMESTAMP(NOW())
GROUP BY address;
SELECT username as address,
((COUNT(*) * POW(2,32))/10800) as hashrate
FROM shares
WHERE our_result <> 'N'
AND UNIX_TIMESTAMP(time) BETWEEN (UNIX_TIMESTAMP(NOW())-10800)
AND UNIX_TIMESTAMP(NOW())
GROUP BY address;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment