Power not come from knowledge kept, but come from knowledge shared.
CURRENT DATE CURRENT TIME CURRENT TIMESTAMP
SELECT *, CURRENT TIMESTAMP FROM SCHEMA.TABLE_A; SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1 FETCH FIRST 1 ROWS ONLY;
ถ้าเป็นของ Informix ใช้คำสั่งselect current from systables where tabid=99;select today from systables where tabid=99;Informix มี function เกี่ยวกับ date/time อีกมากมาย ที่ http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls1035.htm
ถ้าเป็นของ Teradata ใช้คำสั่งselect date; -- system dateselect time; -- system timeselect current; -- system timestamp
ถ้าเป็นของ Oracle ใช้คำสั่งselect sysdate from dual; --system timestampอยากได้ date หรือ time ก็ใช้ function to_date, to_char แปลงเอาอีกที
Post a Comment
3 comments:
ถ้าเป็นของ Informix ใช้คำสั่ง
select current from systables where tabid=99;
select today from systables where tabid=99;
Informix มี function เกี่ยวกับ date/time อีกมากมาย ที่ http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls1035.htm
ถ้าเป็นของ Teradata ใช้คำสั่ง
select date; -- system date
select time; -- system time
select current; -- system timestamp
ถ้าเป็นของ Oracle ใช้คำสั่ง
select sysdate from dual; --system timestamp
อยากได้ date หรือ time ก็ใช้ function to_date, to_char แปลงเอาอีกที
Post a Comment