Posted By

tucq88 on 01/10/13


Tagged

mysql field virtual conditions


Versions (?)

[MySQL] Add condition to Virutal Fields


 / Published in: MySQL
 

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

  1. SELECT
  2. id,
  3. user_id,
  4. defeated_login_boss_id,
  5. number_of_times,
  6. SUM(number_of_times) AS total
  7. FROM
  8. tb_user_login_boss_collections
  9. WHERE defeated_login_boss_id = 2
  10. GROUP BY user_id
  11. HAVING total > 9

Report this snippet  

You need to login to post a comment.