1
CONCAT(ISNULL(NES.NumberOfNomination, ''), '/', ISNULL(TP.NoOfSeats, '')) as Seats,
當TP.noOfseats
是0
我希望列中的列在查詢中爲空。當數據爲0時顯示空白else連續函數的值
CONCAT(ISNULL(NES.NumberOfNomination, ''), '/', ISNULL(TP.NoOfSeats, '')) as Seats,
當TP.noOfseats
是0
我希望列中的列在查詢中爲空。當數據爲0時顯示空白else連續函數的值
你可以使用一個case
表達:
CASE TP.noOfseats
WHEN 0 THEN ''
ELSE CONCAT(ISNULL(NES.NumberOfNomination, ''),
'/',
ISNULL(TP.NoOfSeats, ''))
END AS Seats
CONCAT(ISNULL(NES.NumberOfNomination, ''), '/',
ISNULL(CASE WHEN TP.NoOfSeats = 0
THEN ''
ELSE TP.NoOfSeats END, '')
) as Seats,
不工作對我來說 – Ahaliya
@Ahaliya護理更具體? – Mureinik