Page 1 of 1

Click Tracking

Posted: Thu May 25, 2006 9:54 am
by JayBird
I am counting as best i canthe unique hits to specific jobs on a job site i am developing.

I ha

Code: Select all

ID  SessionID                          Date			userIP		    jobID
1	1a4012cae0564bd1fd1ba28a59617cc1	1148567929	81.153.130.30	1
2	1a4012cae0564bd1fd1ba28a59617cc1	1148567954	81.153.130.30	1
3	1a4012cae0564bd1fd1ba28a59617cc1	1148568004	81.153.130.30	1
4	650feced17da4214d677522f00b447a8	1148568064	54.121.192.56	1
5	1a4012cae0564bd1fd1ba28a59617cc1	1148568316	81.153.130.30	2
6	1a4012cae0564bd1fd1ba28a59617cc1	1148568508	81.153.130.30	1
Can i get the total unique hits for each individual job using just one query!?

If so, roughly what would the query look like.

The result for the above sample data should be

Job 1 = 2 unique hits
Job 2 = 1 unique hit

Thanks

Posted: Thu May 25, 2006 10:09 am
by JayBird
Think i may have sorted it myself. Think this does the trick

Code: Select all

SELECT COUNT(DISTINCT(`sessionID`)) as `uniqueHits`, `jobID` from `database`.`clickStats` GROUP BY `jobID`