Johurt

[SQL] Same IP count

Jan 27th, 2021 (edited)
864
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT  a.NAME,
  2.         a.IP,
  3.         (SELECT COUNT(ID) FROM USERS WHERE IP = a.IP AND STATUS = 1) AS C
  4. FROM (
  5.     SELECT  NAME,
  6.             IP
  7.     FROM USERS
  8.     WHERE NAME = 'Laurynas_Leigon'
  9.     LIMIT 1
  10. ) a
RAW Paste Data