Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Postgresql Query Help

  • 11-03-2012 3:39am
    #1
    Registered Users, Registered Users 2 Posts: 2,789 ✭✭✭


    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.


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭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 ?


Advertisement