Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL Select Distinct

Status
Not open for further replies.

mousematt

MIS
Feb 5, 2001
102
GB
Hi, need some sql help

I have a table that i use to log IP Addr's and dates of people looking at my site, I want to count the entries for each dates so I can make a graph, any ideas?

table is simple looks like;

t_id t_ip t_date

 
Hi,

I would use group by rather than distinct.
Something like this:
select t_date, count(*) from my_table group by t_date;
Or perhaps this:
select t_ip, t_date, count(*) from my_table group by t_ip, t_date;

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top