Discussions
Categories
Groups
Advertisement
Child Item
Home
Topics
Technology & Internet
Software & Web Development
Development
Postgresql Query Help
wandererz
Hi,
I have a postgresql query which i have managed to get functional as follows:
select subtype as event_type, count(*) as totalnum
from $log
where $filter
and action='client-authentication'
and MAC='60:fb:42:d8:60:7e'
group by event_type
This gives me a count based on
action='client-authentication'
and specific MAC='60:fb:42:d8:60:7e'
However i will have multiple MAC addresses and duplicates.
How can i adapt the above query to show me entries with the MAC field populated and exclude duplicates.
Have limited knowledge of SQL queries these days!
Thanks in advance.
Find more posts tagged with
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
Advertisement
Advertisement
Comments
amen
[PHP]
select DISTINCT MAC,subtype as event_type, count(*) as totalnum
from $log
where $filter
and action='client-authentication'
group by MAC,event_type
[/PHP]
should do it for you but why would you want to exclude a duplicate MAC ?