Insert date in db2

How can I insert a date in db2 in this format: yyyy-mm-ddusing sql query?

+5
source share
1 answer

Consider the table:

CREATE TABLE tab (dt DATE);

Now enter the date in it as:

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

Now at execution

SELECT * from tab; 

we get:

DT
2010-12-31
+10
source

All Articles