select distinct on one paticular column

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

select distinct on one paticular column

Post by GeXus »

I have a situation where I'm tracking clicks, I want to be able to report on unique clicks (Based on unique ip address) and total clicks.

I would imagine this would be a matter of selecting distinct ip address, but how do I do that without having the other select columns be distinct?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: select distinct on one paticular column

Post by John Cartwright »

Code: Select all

SELECT ... GROUP BY `ip`
Post Reply