Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all rows where date column has timestamp = 00:00:00.000

I have a table in which one column as registrationDate whose type is datetime. I need to find all the rows where registrationDate as timestamp as 00:00:00.000. for example :

registrationDate: '2019-03-20 00:00:00.000'

I need to query something similar as below :

select * from table where registrationDate like '%00:00:00.000';
like image 276
Ishant Gaurav Avatar asked Dec 18 '22 17:12

Ishant Gaurav


1 Answers

You can cast datetime as time:

WHERE CAST(registrationDate AS TIME) = '00:00'
like image 188
Salman A Avatar answered Jan 22 '23 10:01

Salman A