表数据示例:
id | 是否法定节假日 |
20231007 | 0 |
20231006 | 1 |
... | ... |
说明:id、是否法定节假日均为int型,id对应日期为法定节假日时,是否法定节假日字段对应为1,否则为0
解决方法如下:
select id,
case when id in (yyyymmdd,...) then 1 else 0 end as 是否法定节假日
from 表名
表数据示例:
id | 是否法定节假日 |
20231007 | 0 |
20231006 | 1 |
... | ... |
说明:id、是否法定节假日均为int型,id对应日期为法定节假日时,是否法定节假日字段对应为1,否则为0
解决方法如下:
select id,
case when id in (yyyymmdd,...) then 1 else 0 end as 是否法定节假日
from 表名