Hi im working on a project, where i have a table named users it has data like name,email,dateofBirth(yyyy-mm-dd) where user_id is PRI Key
嗨我正在一个项目,我有一个名为用户的表,它有像名称,电子邮件,dateofBirth(yyyy-mm-dd)这样的数据,其中user_id是PRI Key
I need a query where i should get all the mail id's of the users, except the one who is celebrating the birthday tomorrow
我需要一个查询,我应该获得用户的所有邮件ID,除了明天庆祝生日的人
example : If a,b,c,d are users if d is celebrating birthday tomorrow i need a query for getting others mail id's except d's the before day
例如:如果a,b,c,d是用户,如果d明天正在庆祝生日,我需要一个查询,以获取其他邮件ID,除了前一天
5 个解决方案
#1
0
Use:
WHERE dateofBirth != CURDATE() + INTERVAL 1 day
#2
0
You could try something like
你可以试试像
SELECT "email"
FROM "users"
WHERE "dateofBirth" <> ADDDATE(CURDATE(), INTERVAL 1 DAY);
#3
0
SELECT email
FROM `users`
WHERE `dateofBirth` <> DATE(NOW()+ INTERVAL 1 DAY);
#4
0
Try with this you will required reult
试试这个你需要reult
select email from users where dateofbirth <> DATE_ADD(CURDATE(), INTERVAL 1 DAY);
#5
0
You could do this way.
你可以这样做。
SELECT email
FROM users
WHERE dateofBirth = ADDDATE(CURDATE(), INTERVAL 1 DAY);
Try this.
#1
0
Use:
WHERE dateofBirth != CURDATE() + INTERVAL 1 day
#2
0
You could try something like
你可以试试像
SELECT "email"
FROM "users"
WHERE "dateofBirth" <> ADDDATE(CURDATE(), INTERVAL 1 DAY);
#3
0
SELECT email
FROM `users`
WHERE `dateofBirth` <> DATE(NOW()+ INTERVAL 1 DAY);
#4
0
Try with this you will required reult
试试这个你需要reult
select email from users where dateofbirth <> DATE_ADD(CURDATE(), INTERVAL 1 DAY);
#5
0
You could do this way.
你可以这样做。
SELECT email
FROM users
WHERE dateofBirth = ADDDATE(CURDATE(), INTERVAL 1 DAY);
Try this.