Avatar of Sam OZ
Sam OZ
Flag for Australia asked on

Sql script for Sql server - Get unique user login count from a custom login table

I have a table in Sql server 2018  TB_Login  ( This is another application login details not Sql server login) 
UserID      LoginMonth
UserID1      202103
UserID1      202103
UserID2      202103
UserID3      202104
UserID1      202104
UserID3      202104
UserID4      202104

......

How can I get the unique count of users per month ?  In this case result is
202103       2
202104       3  

SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
Ryan Chong

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ryan Chong

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck