to_char()将时间值转换为字符串,to_date()将字符串转换为时间
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'mm')='07';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy')='1958';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm')='1958-04';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm-dd')='1958-04-13';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm-dd')>'1958-04-13';
select customer_id,first_name||''||last_name,dob from customers where dob=to_date('1958-4月-13','yyyy-month-dd');
select customer_id,first_name||''||last_name,dob from customers where dob>to_date('1958-4月-13','yyyy-month-dd');