usergrade表
1.找到里面username是null的行
SELECT * FROM usergrade WHERE ISNULL(USERNAME)
SELECT * FROM usergrade WHERE USERNAME IS NULL
2.找到里面username不是null的行
SELECT * FROM usergrade WHERE USERNAME IS NOT NULL
3.列出所有的行,并且将username是null的字段替换为lxy
SELECT IFNULL(USERNAME,‘lxy‘),GRADE FROM usergrade
IF(`apformId` IS NULL,0,1) hasPlan
如果apformId是null,选0,不是选1
原文地址:https://www.cnblogs.com/Lzf127/p/8125848.html
时间: 2024-11-08 12:17:54