Guest User

Untitled

a guest
May 28th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.33 KB | None | 0 0
  1. SELECT
  2.     id,
  3.     tag,
  4.     user_id,
  5.     table_id,
  6.     key_id,
  7.     tag,
  8.     `class`,
  9.     COUNT(SELECT subTag.tag FROM `tags` AS subTag WHERE subTag.tag = curRow.tag)
  10. FROM
  11.     `tags` AS curRow
  12. WHERE
  13.     curRow.table_id = 'application'
  14. AND
  15.     ((
  16.         curRow.user_id = 500
  17.     OR
  18.         curRow.class = 0
  19.     ))
  20. ;
Add Comment
Please, Sign In to add comment