How to convert Date on MySQL (variable error) -
i have created table on mysql :
create table apolo( date date, name varchar(50) );
i have imported excel file :
load data local infile 'c:/users/file.csv' table apolo fields terminated ',' enclosed '"' lines terminated '\n' ignore 10 rows (@date, name); set date=str_to_date(@date,'%d/%m/%y');
and error :
error code: 1193. unknown system variable 'date'
if not put line :
set date=str_to_date(@date,'%d/%m/%y');
i not error if try use :
select count(*) apolo date='03/09/2015';
it not work. format not recognisable.
check date column values in database. default date format in mysql database y-m-d
do have values in format.
Comments
Post a Comment