我想使用查询检查条件
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是否可用意味着amount=200 else 0
最佳答案
您可以在 select 中使用 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
关于php - 无法使用日期函数获得结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52565434/