我有一個表與冠軍:Letter1,Letter2,Letter3 ......直到6串聯冠軍名1
Structure of my table:
TYPEID | BenefitsID | Letter1 | Coef1 | Letter2 | Letter3 | Coef3 | Letter4 | Coef4 | Letter5 | Coef5 | Letter6 | Coef6 | Resultat
我想在WHILE循環這樣的選擇要求:
@count =1;
While (@count<7)
begin
@letter = **(select [email protected] from ....)**
..
end
我想要的結果是選擇Letter1,Letter2 ...和Coef1,Coef2 ...的值,並將它們插入冠軍結果中。在一個請求中。大膽的請求會起作用嗎?還是應該使用別的東西?
我使用SQL Server 2008的..
請用您正在使用的數據庫標記您的問題。此外,樣本數據和期望的結果將有助於澄清你想要做什麼。 –
請求的結果不清楚,請添加數據示例 –
我編輯了我的第一篇文章,現在清楚了嗎? – almaje