There are fields, a, B:
A saved: 2016-10-10
B Saved is: 10:15:30
MySQL merges the fields :
Concat (A, '-', b) or concat (A, ", b)
Character time to time stamp
Unix_timestamp (Concat (A, ", b))
The Name field as the Where condition:
There is a special rule in MySQL that column aliases are not allowed as query criteria. For example, there is a table below:
Select
Id
Title
Concept
Conceptlength,
Adduserid,
Modifytime
From Collections_wisdom
Modify the SQL as follows:
Select
Id+1 as NewID,
Title
Concept
Conceptlength,
Adduserid,
Modifytime
From Collections_wisdom
where NewID>2
Then, there will be an exception to execute:statementcallback; bad SQL grammar
Really to execute, had to put the new field composition in the condition to be realized again, as follows:
Select
Id+1 as NewID,
Title
Concept
Conceptlength,
Adduserid,
Modifytime
From Collections_wisdom
where (id+1)>2
A column alias is not allowed in MySQL as a query condition, it is said that the alias of the column in MySQL is originally displayed when the result is returned, not in SQL parsing. Before there is no more convincing explanation, right vote as such.
Alternatively, you can put the merged characters directly in the where :
Unix_timestamp (Concat (A, ', b)) BETWEEN:startTime:AND:endTime:
MySQL: Two fields merge, character time to timestamp, and name field as a Where condition query