我有一個數據表中的一些事情是這樣的:SQL:從同桌的替代值更新表,如果缺少值
-------------------------------------------------------
member id | Email_address | alternate_Email_Address
------------------------------------------------------
001 | [email protected] | [email protected]
001 | | [email protected]
001 | | [email protected]
002 | [email protected] | [email protected]
002 | | [email protected]
我想運行一個SQL將複製的電子郵件地址的所有地方所有alternate_Email_Address都是一樣的。
運行SQL後,我想表是這樣的:
-------------------------------------------------------
member id | Email_address | alternate_Email_Address
------------------------------------------------------
001 | [email protected] | [email protected]
001 | [email protected] | [email protected]
001 | [email protected] | [email protected]
002 | [email protected] | [email protected]
002 | [email protected] | [email protected]
我刪除了必要的標籤。我也刪除了mysql和sql-server標籤,因爲你沒有使用兩者。請僅添加您實際使用的數據庫的標籤。 –
請用您真正使用的數據庫標記您的問題。另外,最後一行如何得到「ss.gmail.com」? –
你是說你想刪除地址不一樣的所有行嗎? –