Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting a date into db2

Tags:

sql

database

db2

How can I insert a date into db2 in this format: yyyy-mm-dd, using a sql query?

like image 757
akp Avatar asked Oct 04 '10 06:10

akp


1 Answers

Consider a table:

CREATE TABLE tab (dt DATE);

Now insert a date into it as:

INSERT INTO tab VALUES ('2010-12-31');

Now on doing

SELECT * from tab; 

we get:

DT
2010-12-31
like image 163
codaddict Avatar answered Oct 23 '22 09:10

codaddict