我有以下形式SQL查詢循環在給定的數據
ID Description
------- ------------------------
83633 Reserves - 1
83634 Reserves - 2
83635 Reserves - Total
83636 X Reserves
83637 E Reserves
83638 Oil
83639 NGL
83640 NB Gas
83641 NU Gas
102195 Proved Reserves - D
102196 Proved Reserves - U
102197 Proved Reserves - Total
102198 Probable Reserves - Gross
102199 Proved Reserves - G1
102200 Proved Reserves - G2
102201 Proved Reserves - G3
102202 Proved Reserves - G4
102203 Proved Reserves - N1
102204 Proved Reserves - N2
102205 Proved Reserves - N3
102206 Proved Reserves - N4
102207 Probable Reserves - G1
102208 Probable Reserves - G2
102209 Probable Reserves - G3
102210 Probable Reserves - G4
102211 Oil
102212 NGL
102213 CNG
102214 Natural Gas
的數據我想編寫一個查詢只有一個選擇標識的該增量。例如,如果我給首發ID=83633
那麼該查詢應該返回以下數據
ID Description
------- ------------------------
83633 Reserves - 1
83634 Reserves - 2
83635 Reserves - Total
83636 X Reserves
83637 E Reserves
83638 Oil
83639 NGL
83640 NB Gas
83641 NU Gas
在遇到ID = 102195
查詢必須停止執行。先謝謝您的幫助!!
,其中83633和102195秩序之間的ID通過ID 你在尋找什麼有什麼關係?之間的任何id被刪除,比如說83634 – KumarHarsh