結合我有一個表稱爲員工具有以下字段TSQL -Eliminating重複從ResultSet和他們在一個單行
Id | Name | PrimaryEmail1 | PrimaryEmail2 | PrimaryEmail3 1 | JonSkeet | NULL | NULL | [email protected] 1 | JonSkeet | NULL | [email protected] | [email protected] 1 | JonSkeet | [email protected] | NULL | [email protected] 2 | George | [email protected] | NULL | NULL 2 | George | NULL | [email protected] | NULL 2 | George | NULL | NULL | [email protected]
如何寫一個TSQL查詢,這樣我可以得到下面的結果集?
Id | Name | PrimaryEmail1 | PrimaryEmail2 | PrimaryEmail3 1 | JonSkeet | [email protected] | [email protected] | [email protected] 2 | George | [email protected] | [email protected] | [email protected]
是你有什麼不同的值PrimaryEmail3爲JonSkeet? – gbn 2012-02-01 12:47:35