Last active
February 10, 2017 19:11
-
-
Save 5a494d/69952b2fcd058d249bc92fdfde431e19 to your computer and use it in GitHub Desktop.
multiple clauses with mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
T0.client_id, name, exts, vms, ivrs, queues, conf10, conf20, conf30 | |
FROM | |
vw_clients T0 | |
left join vw_exts T1 on T0.client_Id=T1.client_id | |
Left join vw_vms T2 on ... | |
... | |
Where ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SUM(category='x') as tot_x, | |
SUM(category='y') as tot_y, | |
SUM(category='z') as tot_z | |
FROM table | |
WHERE cid='290463' and category in ('x', 'y', 'z') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment