I have this table:
id int, name nvarchar(max), ..............
Example:
------------------
| id | name |
------------------
| 1 | Mohammed |
| 2 | Mohammed |
| 3 | Sakher |
| 4 | Sakher |
| 5 | Ahmad |
| 6 | Ahmad |
| 11 | Hasan |
| 50 | Hasan |
| 17 | Sameer |
| 19 | Soso |
| 110 | Omar |
| 113 | Omar |
| 220 | Omar |
------------------
I am trying to write a query to result this:
id1 int , id2 int , name nvarchar(max)
Example:
------------------------
| id1 | id2 | name |
------------------------
| 1 | 2 | Mohammed |
| 3 | 4 | Sakher |
| 5 | 6 | Ahmad |
| 11 | 50 | Hasan |
| 110 | 113 | Omar |
| 110 | 220 | Omar |
| 113 | 220 | Omar |
------------------------
Return the duplicates in one of the columns. I prefer SQL Server query or standard ANSI SQL one.