views:

18

answers:

1

Hey all,

I have a table Logins { Id, AccessTime }, I'd like to write a query that returns 3 columns, Total Logins during a time period, Unique Logins for a time period, and the Id of the user.

I know I could do this with two passes and a join, is there a better way to do it in a single pass?

Thanks, ~Prescott

Edit: After considering this futher, if they they show up at all, then they are a unique login, thus I can just grab count(*), userId group by userid.

Sorry for the sillyness.

A: 

Poorly thought out before asking this question, essentially, if they have a record in the date period for Count(*), then their unique login is 1..

Prescott