to_date function
oracleNov 22 2005 — edited Nov 22 2005Currently I am given the job to customize my previous colleagues work on PL/SQL.
The WHERE clause of a SQL statement to compare two DATE fields in the format of DD/MM/YYYY HH24:MI:SS is written as:
"WHERE to_date(to_char(rental_charge_date,'DD/MM/YYYY'),'DD/MM/YYYY') <= to_date(to_char(RUN_DATE,'DD/MM/YYYY'),'DD/MM/YYYY')".
My question is aint it enough to write the statement as
"WHERE to_char(rental_charge_date,'DD/MM/YYYY') <= to_char(RUN_DATE,'DD/MM/YYYY')".
Also the same kind of WHERE clause is used for around 8 times in different places. If I change it to my suggestion will it improve the performance or it will give only code enhancement.
Regards
Dinesh