Untitled

From Commodious Leopard, 4 Months ago, written in Plain Text, viewed 96 times. This paste will self destruct in 6 Months.
URL http://codebin.org/view/fb9f7a0e Embed
Download Paste or View Raw
  1. --первый код
  2.  
  3. SELECT support_rep_id,
  4.        count(support_rep_id)
  5. FROM client
  6. WHERE email like '%@yahoo.%'
  7.   OR email like '%@mgail.%'
  8. GROUP BY support_rep_id
  9.  
  10. --второй код
  11.  
  12. SELECT support_rep_id,
  13.        COUNT(CASE
  14.                  WHEN email LIKE '%@yahoo.%'
  15.                       OR email LIKE '%@gmail.%' THEN 1
  16.              END) AS user_count
  17. FROM client
  18. GROUP BY support_rep_id;

Reply to "Untitled"

Here you can reply to the paste above