Home > database > The same executable SQL command, but the Mysql always hint statements incorrect, for advice
The same executable SQL command, but the Mysql always hint statements incorrect, for advice
Time:10-12
Select dt=the convert (varchar (13), [time], 120), Qty=count (1) The from [table name] Group by the convert (varchar (13), [time], 120) The order by the convert (varchar (13), [time], 120)
The same why SQL statements can normal execution, but the MYsql is not? Consult everybody a great god
CodePudding user response:
Select dt=the convert (varchar (13), event_time, 120), Qty=count (1) The from th_event_info Where event_time between '2019-09-23 00:00:34. 000' and 'the 2019-09-25 00:00:34. 000' Group by the convert (varchar (13), event_time, 120) The order by the convert (varchar (13), event_time, 120)
Select [SQL] dt=the convert (varchar (13), event_time, 120), Qty=count (1) The from th_event_info Where event_time between '2019-09-23 00:00:34. 000' and 'the 2019-09-25 00:00:34. 000' Group by the convert (varchar (13), event_time, 120) The order by the convert (varchar (13), event_time, 120)
(Err), 1064 - You have an error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar (13), event_time, 120), Qty=count (1) The from th_event_info Where ev 'at line 1
Below is the return error but I don't know where there are problems
CodePudding user response:
The Convert function usage right: 1. The convert (value, type) 2. The available types are: Binary, char (), the data, time, datetime, decimal, signed and unsigned
So it should be: select the convert (event_time, char (13)) * * * * *