This query returns all the rows from my table, even where the end_timestamp is not defined:
SELECT * FROM table
WHERE UNIX_TIMESTAMP(end_time) >= UNIX_TIMESTAMP('1448914804')
AND UNIX_TIMESTAMP(end_time) <= UNIX_TIMESTAMP('1448914804')
This query works fine but I want to pass timestamp:
SELECT * FROM commercial
WHERE UNIX_TIMESTAMP(end_time) >= FROM_UNIXTIME('2015-11-30 20:14:00')
AND UNIX_TIMESTAMP(end_time) <= FROM_UNIXTIME('2015-11-30 20:14:05')
AND end_time IS NOT NULLto the first query fix it? Depends on the default value you set for the column.