Sunday, February 19, 2012

Help me in writing sql query

When a user logs in the system I mark a Table in the database(that is a new id is generated)
Now I need to write a query which actually gets the following things--

1)Total no of people logged in the system for a given date
2)Minimum no of people logged in the system for a given date
3)Maximum no of people logged in the system for a given date
4)Average no of people logged in the system for a given date.

Hope You guys would help me in writing this query

ThanksWell, if all you're logging is when someone logged in, the only thing I can see you being able to get is the count of how many people logged in on a given date.
How long can people keep their connections? Overnight?
Unless you've also kept track of when they logged out, I don't see any way to know how many people were logged in at a given time. So I don't see a way to get the minimum, maximum or average.

No comments:

Post a Comment