LemonInflux Posted June 28, 2008 Share Posted June 28, 2008 Hello. I'm doing a project where I have a table like this: ID | IP | VISITS ------------------ 1 | 127.0.0.1 | 2 2 | 127.0.0.1 | 3 Basically what happens is when a user views a page, the code looks in another table to see if the page has an ID (if it doesn't, it creates a new row to assign said page an ID). Then in this table, a new row is added containing the page id, the user IP, and the number of times the IP visits that page ID (of course, this will be updated by the script). Now what I want to do is work out how many unique visitors have gone on my site. To do this I'll need to select every row that doesn't contain the same IP as a row selected before. How is this done? Thanks ---------------- Now playing: Enter Shikari - Today Won't Go Down In History via FoxyTunes Quote Link to comment Share on other sites More sharing options...
webent Posted June 28, 2008 Share Posted June 28, 2008 Maybe something like... SELECT SUM(VISITS) FROM TABLE GROUP BY IP; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.