Mysql Notes

JOIN with the same table with COUNT

SELECT a . * , b.CountIp
FROM Counter a
JOIN (
SELECT Ip, COUNT( Ip ) AS CountIp
FROM Counter
GROUP BY Ip
)b ON a.IP = b.Ip
ORDER BY a.LogTime DESC
page_revision: 4, last_edited: 1234553142|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License