Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2015
    Posts
    2

    Unanswered: MySQL query count group having > etc

    Hi,

    Firstly please excuse my ignorance I'm new to the forum. I'm hoping someone can help me modify the following MySQL query to return all rows not just the single row returned due to the group by aggregation:

    select count(t.sess2servers) as event, t.username, s.hostname from sessions t, servers s where t.sess2servers = s.serverid group by t.sess2servers having event > 5;

    I would like to return all username connected to the same hostname if there are more than 5 connections etc.

    Any help would be much appreciated. Thanks

  2. #2
    Join Date
    Apr 2015
    Posts
    2

    Resolved by using a subquery

    I have managed to get the desired results by using a subquery.

    Thanks to everyone for looking.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •