How to combine GROUP BY and ROW_NUMBER ( ) OVER

by user172047   Last Updated February 11, 2019 08:06 AM

I Have

CusID Name Country PhoneNo
------------------

1     JOHN USA     555555
1     JOHN USA     555554
2     MIKE CANADA  111111
2     MIKE CANADA  122222
5     JOHN UK      888888
5     JOHN UK      888889

I want to display output like this:

CusID Name Country PhoneNo
------------------

1     JOHN USA     555555
                   555554
2     MIKE CANADA  111111
                   122222
5     JOHN UK      888888
                   888889

(or) any other methods in SQL?

Tags : sql-server


Related Questions


Updated September 03, 2018 18:06 PM

Updated March 16, 2016 08:02 AM

Updated July 10, 2018 15:06 PM

Updated October 16, 2018 13:06 PM

Updated April 15, 2016 08:02 AM