-1
有人能告訴我我的case語句有什麼問題嗎?帶有子查詢的SQL Case語句
select
(case
when (select top 1 descr from t1 inner join t2 on t2.id = t1.id where t1.code = '17418')= 'C' Then 'Cancelled'<br/>
when (select top 1 descr from t1 inner join t2 on t2.id = t1.id where t1.code = '100020')= 'CL' Then 'Closed'<br/>
when (select top 1 descr from t1 inner join t2 on t2.id = t1.id where t1.code = '1105')= 'R' Then 'Reserved'<br/>
when (select top 1 descr from t1 inner join t2 on t2.id = t1.id where t1.code = '1106')= 'S' Then 'Scheduled' <br/>
else null end) <br/>
From table
爲什麼你覺得有什麼錯呢? –
這是有效的代碼還是僞代碼?什麼是「從表格」? – Parfait
它只是拉第一個陳述而不是其他 – Jason312