我想使用查询检查条件
select min(date_format(date(time_stamp),'%Y-%m-%d'))as time_stamp,
'FN' period,
null count ,
null sheetno,
if (count(min(date_format(date(time_stamp),'%Y-%m-%d')))=1 ,200,0) as amount
from omr_verification
我想计算time_stamp是否可用,意味着数量= 200,否则为0
答案 0 :(得分:0)
可以使用if条件或case进行选择。
select min(date_format(date(time_stamp),'%Y-%m-%d'))as time_stamp,
'FN' period,
null count ,
null sheetno,
if (time_stamp !='' ,200,0) as amount from omr_verification