Hello,
I have a query below:
select UserLogon, ROW_NUMBER() OVER(Order By createdon desc) as ID, Description, IP, CreatedOn from eventlog
Group by UserLogon, Description, IP, CreatedOn
order by createdon desc
What I really want to do is to return auto number, but I want the auto number starts from 1 for each new group (in this case UserLogon)
Can any one tell me how to do this? Thanks lots.