sql:按最近日期查询未来预约订单

jq6vz3qz  于 2021-08-13  发布在  Java
关注(0)|答案(1)|浏览(359)

Appointments :

id  int(11) Auto Increment  
appointment_number  varchar(150) NULL   
facility_id int(11) 
practitioner_id int(11) 
calendar_id int(11) 
calendar_service_id int(11)     
patient_id  int(11) 
patient_relative_id int(11) NULL    
first_name  varchar(200)    
last_name   varchar(200) NULL   
email   varchar(100) NULL   
phone   varchar(100) NULL   
birthdate   date NULL   
fg_gender   tinyint(2) NULL 
start_time  datetime    
end_time    datetime
r6l8ljro

r6l8ljro1#

我想从 tinyint(2) 引用这是sqlite或mysql/mariadb。因此,对于sqlite:

SELECT * FROM appointments WHERE start_time > datetime('now') ORDER BY start_time ASC

对于mysql/maria:

SELECT * FROM appointments WHERE start_time > now() ORDER BY start_time ASC

相关问题