0

I'm going to generate timestamp from a date

set @inputDate = '2016-04-21';
select timestamp(@inputDate) from dual;

the result is:

2016-04-21 00:00:00

like midnight time. How can I know that the input file was generated without time or it's midnight timestamp?

  • If keep that distinction is important, you create a flag, the one you create from a date without out time have `1` the one with time `2` – Juan Carlos Oropeza Nov 23 '16 at 17:54
  • @JuanCarlosOropezaThanks for the answer, you right it's a good solution but I should keep it in the database. Hence, I'm looking for another solution from data-time logic in MySql database engine instead of saving the flag in the database. – Gh.Ravandi Nov 23 '16 at 21:40
  • I dont see how you can difference between both without a flag. – Juan Carlos Oropeza Nov 23 '16 at 23:46

0 Answers0