Select * from a where the time between (' 2020-01-01) and (' 2020-10-10 ') and ss=1
Select * from a where the time between '2020-01-01' and '2020-10-10' and ss=1
Select * from a where clause (time between '2020-01-01' and '2020-10-10') and ss=1
This three sentences:
In addition, in between the and and & lt;> , execution efficiency?
CodePudding user response:
You this statement, one less quotes,If you don't take into account the issue of quotation marks, the three statements is the same,
Between the and is to obtain a certain range of content, & lt;> Is the content of the gain in addition to the specified value,
Most of the situation between the and than & lt;> High efficiency,
CodePudding user response:
Leave a message,I was concerned about the 3 is the same, (although I think it is the same)
CodePudding user response:
Upstairs, what do you think of this two, what's the difference?SELECT * FROM TABLE_NAME WHERE CREATE_TIME BETWEEN '2020-01-01 00:00:00' AND 'the 2020-01-01 23:59:59';
SELECT * FROM TABLE_NAME WHERE CREATE_TIME LIKE '% 2020-01-01;
CodePudding user response:
No more invisible transformation, performance,Between the internal and & lt;=& gt;=, performance,
Between the and is combined, syntax parsing will as a whole, no difference with or without parentheses,
CodePudding user response:
Statements are exactly the same,Can be used to explain the extended directly show warnings the message after mysql parsing statements are all the same.