I have question that if I have date as string in one column of table on that date basis I want to sort the table into the database. How can I perform this operation?
create table dateTable (
_id INTEGER,
date varchar2(50),
name varchar2(50)
);
The DBMS is Oracle, if that matters.
Q: so will there be multiple formats for date, say “dd-mm-yyyy” or “mm-dd-yyyy” in the date field?
A: Yes, the user can type in any format.
Add one more column and insert format of the date value. Use that column in the order by clause by converting the varchar to date using “to_date(date_value,date_format)”