2 Replies Latest reply on Jan 21, 2009 10:41 AM by Eamo

    Creating a sql query to count logins

    Rookie

      Hi Everyone,

       

      First time poster, shortish time reader. Trying to put together a sql statement that will count the number of devices someone is logged into and display the device name. Here is what I have so far..

       

      select LoginName, count(LoginName)
      from dbo.Computer
      Group by LoginName Having count(LoginName) > 1

       

      This those the counting part fine, but when I addin DeviceName to the select part, it falls over.

       

      Any ideas?

       

      Thanks!