✅ 操作成功!

sql 语句if函数

发布时间:2023-06-11 作者:admin 来源:文学

sql 语句if函数

sql 语句if函数

sql语句中的if函数使用,如果满足一个件条可以赋一个需要的值,方便代码判断 eg: SELECT *,if(ebay_excludecountrymodel.id is null,'false','true') checked FROM ebay_exshiplocation e left join ebay_excludecountrymodel on e.site=ebay_excludecountrymodel.site and e.id= ebay_excludecountrymodel.excludecountryid and ebay_excludecountrymodel.site=186 where e.site=186; SELECT `user`.realname, if(`user`.realname IS NULL , '有值' ,'无') checked from user LEFT JOIN user_other_info ON `user`.id=user_other_info.id

👁️ 阅读量:0