Hello all,
I am trying to select distinct clientid, date, location from the the most frequent value of location from each client within the day.
For example
And expected output should be
Any help would be much appreciated.
Thanks guys
I am trying to select distinct clientid, date, location from the the most frequent value of location from each client within the day.
For example
Code:
ClientID Date Location
1 2018-05-01 NY
1 2018-05-01 TOK
1 2018-05-01 HK
1 2018-05-01 NY
1 2018-05-01 NY
1 2018-05-01 NY
1 2018-05-01 NY
1 2018-05-02 HK
1 2018-05-02 HK
1 2018-05-02 HK
1 2018-05-02 HK
1 2018-05-02 HK
1 2018-05-02 HK
1 2018-05-02 SG
2 2018-05-02 SYD
2 2018-05-02 SYD
2 2018-05-02 SYD
2 2018-05-02 SG
2 2018-05-02 SG
And expected output should be
Code:
ClientID Date Location
1 2018-05-01 NY
1 2018-05-02 HK
2 2018-05-02 SYD
Any help would be much appreciated.
Thanks guys