Skip to content

Instantly share code, notes, and snippets.

@alexcharlie
Created October 2, 2009 20:05
Show Gist options
  • Save alexcharlie/200068 to your computer and use it in GitHub Desktop.
Save alexcharlie/200068 to your computer and use it in GitHub Desktop.
mysql> select s.name, sum(sp.points), RPAD('', sum(sp.points) / 1000, '#') as bar from (skill_progresses as sp join users as u on sp.user_id = u.id) join skills s on sp.skill_id = s.id where u.level > 10 group by sp.skill_id;
+-------------------+----------------+------------------------------------------------------------------------------------------------------------+
| name | sum(sp.points) | bar |
+-------------------+----------------+------------------------------------------------------------------------------------------------------------+
| Sabotage | 2411 | ## |
| First Aid | 16928 | ################# |
| Vehicle Operation | 27540 | ############################ |
| Fast Talk | 1060 | # |
| Seduction | 105650 | ########################################################################################################## |
| Tracking | 52910 | ##################################################### |
| Interrogation | 41314 | ######################################### |
| Disguise | 2750 | ### |
| Athletics | 18003 | ################## |
| Streetwise | 35559 | #################################### |
| Hacking | 66102 | ################################################################## |
| Demolitions | 16834 | ################# |
| Gadgetry | 41704 | ########################################## |
| Security | 30689 | ############################### |
| Evasion | 2453 | ## |
| Science | 21827 | ###################### |
| Cryptography | 19886 | #################### |
| Class | 42151 | ########################################## |
| Smooth Talk | 46637 | ############################################### |
| Infiltration | 83528 | #################################################################################### |
+-------------------+----------------+------------------------------------------------------------------------------------------------------------+
20 rows in set (0.04 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment