gpt4 book ai didi

mysql - 当数据为 0 时显示空白,否则 concat 函数中的值

转载 作者:行者123 更新时间:2023-11-28 23:12:12 25 4
gpt4 key购买 nike

CONCAT(ISNULL(NES.NumberOfNomination, ''), ' / ', ISNULL(TP.NoOfSeats, '')) as Seats,

TP.noOfseats0 时,我希望查询中的列为空白。

最佳答案

您可以使用 case 表达式:

CASE TP.noOfseats 
WHEN 0 THEN ''
ELSE CONCAT(ISNULL(NES.NumberOfNomination, ''),
' / ',
ISNULL(TP.NoOfSeats, ''))
END AS Seats

关于mysql - 当数据为 0 时显示空白,否则 concat 函数中的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45488904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com