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');