1
CREATE TABLE test_max (
number_a INT,
number_b INT,
number_c INT,
)
GO
INSERT INTO test_max VALUES(3,7,9)
INSERT INTO test_max VALUES(5,2,10)
INSERT INTO test_max VALUES(31,4,91)
INSERT INTO test_max VALUES(35,124,1)
GO
select number_a,number_b,number_c from test_max
我想打印第四列是MAX(number_a.value,number_b.value,number_c.value)最大的行記錄作爲一列
所以輸出應該像
3 7 9 9
5 2 10 10
31 4 91 91
35 124 1 124
是否有可能不使用PIVOT作爲列可能不只是3?
哇。有用!但是CROSS APPLY如何工作? – Sharktooth
@Sharktooth查看已更新 – lad2025
@Sharktooth如果您的問題存在,您可以[接受我的回答](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235)已解決:) – lad2025