I have an easy question, however I couldn't find the answer for this. In SQL WHERE clause which is better?
TO_CHAR (DAT, 'YYYYMMDD') BETWEEN '20080101' AND '20131231'
or
DAT BETWEEN TO_DATE('20080101','YYYYMMDD') AND TO_DATE('20131231','YYYYMMDD')
Are the condition values evaluated only once and then tested for every row in the table, or does the SQL engine recalculate it every time?