0
我正在製作一個工具,它可以從表列中選擇UCPost值,並將其與同一表的UCPre匹配,並將其插入其他所有細節的表中。匹配Sql Table中兩列的值並將其保存到另一列
表:
**UCID UCName Author UCPre UCPost**
UC01 Login Bilal Haider User must be Registerd User is Loggined sucessfully
UC02 Add User Bilal Haider User is Loggined sucessfully User is added
UC03 Add file Bilal Haider User is Loggined sucessfully File added
UC04 Delete file Bilal Haider File is selected File is deleted
從這個表我選擇 UCID UCPre UCPost 並插入到另一個表名稱測試
**UCId UCPre UCPost UCNext**
UC01 User must be Registerd User is Loggined sucessfully NULL
UC02 User is Loggined sucessfully User is added NULL
UC03 File must be selected File is added NULL
UC04 File is selected File is deleted NULL
UC05 User is Loggined sucessfully User is deleted NULL
我要填寫測試表的UCNext列與UCPre與所選用例的UCPost相匹配的用例的UCId。
與UC01一樣UCPost是用戶在執行查詢時成功登錄,它與UC01的UCPost與所有用例的UCPre相匹配,而UC02和UC03具有相同的UCPre,因此UCNext必須填充UC02,UC03但發生錯誤。
問題: 當我嘗試執行以下語句
更新測試集UCNext =(從UCDetails選擇UCID其中test.UCPost = UCPre)
它給下面的錯誤
Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
請告訴我如何解決這個問題。
尊敬它得到只一個值。是有什麼我可以全部UCIDs與UCPre單UCNext比賽機會呢? – 2015-02-06 18:24:40
親愛的,它只能得到一個值。有沒有機會讓我可以在單個UCNext中與UCPre匹配的所有UCID? – 2015-02-07 11:29:40