Skip to content

Instantly share code, notes, and snippets.

@jbq
Created October 15, 2014 13:49
Show Gist options
  • Save jbq/760052ddb6c4261677fa to your computer and use it in GitHub Desktop.
Save jbq/760052ddb6c4261677fa to your computer and use it in GitHub Desktop.
SQL> select count(*) a, okcfc1, cttx40 from oohead left join ocusma on oacuno=okcuno left join csytab on ctstco='CFC1' and ctstky=okcfc1 where oaadid='ÚÚÚÚÚÚ' and oaordt like '2014%' group by okcfc1, cttx40 order by a desc
+------------+-----------+-----------------------------------------+
| A | OKCFC1 | CTTX40 |
+------------+-----------+-----------------------------------------+
| 152 | 400DC | André Myriam |
| 91 | 400VK | Morand Stéphanie |
| 57 | 400M1 | Valcroze Sandrine |
| 42 | 400F1 | Ivars Amandine |
| 36 | 400ND | Deschamp Nelly |
| 32 | 400Y1 | Nguyen Véronique |
| 23 | 400V3 | Millet Daniel |
| 8 | 400G2 | Peillet Aurélie |
| 5 | 212ED | BARBARA DEMOULIN |
| 1 | 105FR | MARTINE |
| 1 | 400A8 | Narwa Véronique |
+------------+-----------+-----------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment