1.Date类型精确到秒,TIMESTAMP精确到毫秒;在SQL中进行比较时oracle会将精度低的转向精度高的。
2.select * from table where date_col = P_timestamp时,oracle认为P_timestamp的精度更高,所以会自动将data_col转换成to_timestamp(date_col)
PS:阿里09年SQL规范:to_date(:parameter,'yyyy-mm-dd hh24:mi:ss');这种方式需要在java里面将数据toString();可以用cast(:parameter as date)替换。而且在SQL Server、MySQL等数据库里面该函数的实现都一样。