Dineshkumar D Dineshkumar D - 8 days ago 5
MySQL Question

how to get data using date on my time stamp in SQL

My field name

time
and datatype is
timestamp


SELECT
*
FROM
order_table
WHERE
DATE(`time`) AS date_part = '2016-11-30';

Answer

Remove alias from WHERE condition:

SELECT
    *
FROM
    order_table
WHERE
    DATE(time) = '2016-11-30';