Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date 今天是谁';生日_Date_Date Of Birth - Fatal编程技术网

Date 今天是谁';生日

Date 今天是谁';生日,date,date-of-birth,Date,Date Of Birth,我想从我们的数据库中提取所有今天庆祝生日的人,因此我必须从出生日期中提取日期和月份,然后在出生日期字段中搜索日期相同的人。不知道您有什么数据库,但oracle: SELECT * FROM peopleTable WHERE to_number(to_char(date_of_birth, 'YYYY')) = to_number(to_char(sysdate, 'yyyy')) AND to_number(to_char(date_of_birth, 'MM')) = to_number(t

我想从我们的数据库中提取所有今天庆祝生日的人,因此我必须从
出生日期
中提取日期和月份,然后在
出生日期
字段中搜索日期相同的人。

不知道您有什么数据库,但oracle:

SELECT * FROM peopleTable WHERE to_number(to_char(date_of_birth, 'YYYY')) = to_number(to_char(sysdate, 'yyyy')) AND to_number(to_char(date_of_birth, 'MM')) = to_number(to_char(sysdate, 'MM'));
如果您使用的是MYSQL,请查看datepart

你好,Ondkloss,请查看如何询问一个好问题question@Virushunter当前位置Ondkloss没有问