How can i convert 2012-04-12 00:00:00 to a unix timestamp in DB2. is there any inbuild function available in sql s
谢谢。
How can i convert 2012-04-12 00:00:00 to a unix timestamp in DB2. is there any inbuild function available in sql s
谢谢。
采用<代码><和MIDNLI_SECONDS
比更为准确。 TIMESTAMPDIFF
:
SELECT
86400*(DAYS(CURRENT TIMESTAMP - CURRENT TIMEZONE)-DAYS( 1970-01-01 ))
+ MIDNIGHT_SECONDS(CURRENT TIMESTAMP - CURRENT TIMEZONE)
"UNIX_TIMESTAMP"
FROM SYSIBM.SYSDUMMY1
缩略语 我假定,自1970-01 00:00:00 UTC以来,二次(或以任何形式)的数目。
There is no built in functionality for this in DB2 (as of V6R1).
You re also up against the following issues:
CURRENT_TIMESTAMP
writes are based on what time the requesting system thinks it is, not the host.TIMESTAMPDIFF
function returns an estimate, not an exact value. You could probably survive for the years/months durations, over sufficient differences, but days aren t likely to cut it.阁下最好先使用<条码>(接下自0001-01以来的天数)。 牢记你在万国邮联中做得更好,因为它将而不是考虑到国贸总协定。
For DB2... table1.a is varchar(30) and has an index on it. table2.b is varchar(45) and has an index on it. Will table1.a = table2.b use the index on table1, table2, or both? Although it would seem ...
Is this possible to call c/c++ application from DB2 stored procedure/trigger? If yes, what would be general steps doing it? Any pointers to web resources on the subject? Thanks!
Folks, Is it mandatory to use an ALIAS when we are doing some operation on the column? Ex: select upper(col1) from table1 when i am trying to retrieve the resultset by rs.getString("col1"), it was ...
I d like to put a constraint, a check or a foreign key, on two combined fields from table1 to another field in table2. Here is what I tried, but both gave me errors: ALTER TABLE table1 ADD ...
I am experiencing very odd performance on DB2 version 9.1 when running the query below: select a.CYCL_NUM , a.AC_NUM , a.AUTHS_DTE , a.PL_ID , a.APRVD_RSPN_CDE , a.AUTHS_AMT , a....
I am new to DB2 administration on AS400, could you point me to the best practices/tools to search for errors in the DB2 journals? So far I use the DSPJRN command but I am unable to make research. ...
甲状腺可使用其专有的CONNECT,自v2起就进行分级查询。 在最近发表的第11g号新闻稿中,他们增加了复位的分级系数,也称为休养。
In DB2, using the following left join select a.deptno, a.deptname, b.empno from #dept a left join #emp b on a.deptno = b.workdept on two tables, gets me a list like: dpt name emp ----------...