mysql string taken as the query condition where

Yesterday met a demand, had orders table is only for a specific date check orders, and making time queries to the needs of the time would like a mere trifle, every minute to get, then give me a real blow, running after the code is written, discovery query out the results and expected results seem a little gap (this is not a BUG, ​​but the effect is expected and there are gaps, ah, like this)

SQL code and the investigation did not find the problem, and then open the database, look at the date when stored, and instantly think this man might be the devil's design , normal operation without such a memory of it, practitioners 2 years never seen such an operation. . . .

 

Then modify the SQL statement using UNIX_TIMESTAMP (LEFT (time, 10))> = UNIX_TIMESTAMP ( ' ". $ Filter [' y_real_time ']."') Resolve, where time is my database storage field name, $ filter [ 'y_real_time' ] for incoming date

Guess you like

Origin www.cnblogs.com/zdzdbk/p/11242481.html