原文:SQLSerVer計算1-100之間所有能被3整除的數的個數及總和

declare S smallint, I smallint, NUMS smallint set S 總和 set I 從 開始 set NUMS 個數默認為 個 while I lt 循環 begin if I begin set S S I 總和 當 I某個數符合時,就是加它,即得這些數的總和 set NUMS NUMS 如果條件符合個數就自動加班 end set I I 循環加值 end ...

2012-04-28 11:07 0 6040 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM