0
我想列兩行進行比較,它們看起來就像這樣:如何比較SQL Server 2008中的兩行?
The rows 1,columns 1 compare to the other row 2,columns 1.
The rows 1,columns 2 compare to the other row 2,columns 2.
The rows 1,columns 3 compare to the other row 2,columns 3.
The rows 1,columns 4 compare to the other row 2,columns 4.
........
和邏輯是:
if the rows 1 columns 1 equal to rows 2,columns 1
do something
else
do other thing
.........
如何做到這一點?
a. The two rows in the same table.
b. There are only two rows in the table
我想在程序中使用光標,但無法訪問它!謝謝!
「我想使用遊標」 - 也許是這樣,但你可能*不應該*。此表中只有*兩行嗎?還是有*行*對? (如何識別這些對?)。或者應該將每一行與「前一行」進行比較? (在這種情況下,什麼定義了「previous」的定義?)或者這些行在不同的表中? (在這種情況下,我們如何在表格之間配對?) –
繼續編輯您的問題,因爲它仍然不明確 – Leo