Skip to content
Advertisement

Group by Count of DateTime Per Hour by removing Duplicates?

I have a table named loginData:

From this table I want to query the data in such a way that It doesn’t count duplicates. I want to get data like this:

Considering abc has logged in twice to count it as one. How to do this?

Advertisement

Answer

You can use count(distinct):

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement