Wednesday, July 11, 2007

Inserting Date And Selecting Particular Date From Table Using Oracle

Cearting A Sample Table With The Date Field

create table EMP1_Test(id varchar(5),Fname varchar(10), DOB date)
insert into EMP1_Test(ID,FNAME,DOB) values('1','Test',to_date('19991010','yyyymmdd'))
insert into Emp1_Test(ID,FNAME,DOB) values('2','Test',to_date('11101999','mmddyyyy'))

select * from EMP1_test



select * from EMP1_Test where to_char(dob,'MM/DD/YYYY') = '10/10/1999'

No comments: