date_format(str_to_date('10-oct-2006', "%d-%b-%Y"), "%d-%m-%Y")

Thankyou but this already done

i want to call the field at the date place.

select date_format(str_to_date('11-oct-2006', "%d-%b-%Y"), "%d-%m-%Y");
+-----------------------------------------------------------------+
| date_format(str_to_date('10-oct-2006', "%d-%b-%Y"), "%d-%m-%Y") |
+-----------------------------------------------------------------+
| 10-10-2006 |
+-----------------------------------------------------------------+

In mytable i insert the date at use_date.
create table sample(name varchar(20),use_date varchar(16));

insert into sample values('java','11-oct-2006');

select name,date_format(str_to_date('use_date', "%d-%b-%Y"), "%d-%m-%Y") from sample;

but it gives the output like this
+------+--------------------------------------------------------------+
| name | date_format(str_to_date('use_date', "%d-%b-%Y"), "%d-%m-%Y") |
+------+--------------------------------------------------------------+
| java | |
+------+--------------------------------------------------------------+

how to overcome this pls help
Thanks
Sang

你可能感兴趣的:(java)