select * from Employee where Birthday between to_date(to_char(sysdate,'yyyymm')||'01','yyyy-mm-dd') and last_day(sysdate) 可以把sysdate替换为你想要的日期
SELECT * FROM EMPLOYEE WHERE BIRTHDAY LIKE &v_month; --- v_month 输入格式 '2009-05'
如果Birthday为时间类型的话: select * from Employee where to_char(Birthday,'MM') = to_char(sysdate,'MM');如果为字符串的话: select * from Employee where substr(Birthday,6,2) = to_char(sysdate,'MM');
where to_char(to_date(birthdate,'yyyy-mm-dd'),'DD')=to_char(sysdate,'DD')
where to_char(to_date(birthdate,'yyyy-mm-dd'),'DD') in ('04','05','其他指定月份' )
where to_char(to_date(birthdate,'yyyy-mm-dd'),'DD') =to_char(sysdate,'DD')
同意
生日字段:Birthday (如:'2005-04-06'格式的字符串)
如:查04月01日至04月31日之间过生日员工。。
是每月每月的查询。。
from Employee
where Birthday between
to_date(to_char(sysdate,'yyyymm')||'01','yyyy-mm-dd') and last_day(sysdate) 可以把sysdate替换为你想要的日期
FROM EMPLOYEE
WHERE BIRTHDAY LIKE &v_month; --- v_month 输入格式 '2009-05'
select *
from Employee
where to_char(Birthday,'MM') = to_char(sysdate,'MM');如果为字符串的话:
select *
from Employee
where substr(Birthday,6,2) = to_char(sysdate,'MM');
select * from employee where to_char(Birthday,'mm') = to_date(sysdate, 'mm')
select * from employee where to_char(BIRTHDAY,'MM')= ? 问号代表要查的月份
按你说的是'2005-04-06'格式的字符串,但你却用to_char()
select * from employee where EXTRACT(MONTH FROM TO_DATE(birthday, 'yyyy-mm-dd')) = 4;
select * from alarmer.T1 where substr(COLUMN1,6,2)=to_char(sysdate,'MM')
from Employee
group by substr(Birthday,6,2)查询所有月份过生日的人数
from Employee
where Birthday like '2009-06%' (红色月份自己填写)