Skip to content

Instantly share code, notes, and snippets.

@Nitrodist
Created November 20, 2011 14:56
Show Gist options
  • Save Nitrodist/1380329 to your computer and use it in GitHub Desktop.
Save Nitrodist/1380329 to your computer and use it in GitHub Desktop.
use Bank;
SELECT client.client_id, account.account_no, COUNT(transactions.account_no)
FROM client, account, transactions
WHERE client.client_id = account.client_id AND
account.account_no = transactions.account_no
GROUP BY client.client_id, account.account_no
ORDER BY 3 DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment