Return to Snippet

Revision: 61729
at January 10, 2013 13:50 by tucq88


Initial Code
SELECT 
  id,
  user_id,
  defeated_login_boss_id,
  number_of_times,
  SUM(number_of_times) AS total 
FROM
  tb_user_login_boss_collections 
WHERE defeated_login_boss_id = 2
GROUP BY user_id 
HAVING total > 9

Initial URL

                                

Initial Description
By using HAVING 'virtual_field' CONDITION we can add conditions to virtual fields that created at SELECT

Initial Title
[MySQL] Add condition to Virutal Fields

Initial Tags
mysql

Initial Language
MySQL