我正在使用以下查询:
$track_elevations
注意: timestamp列是Char数据类型
答案 0 :(得分:0)
我不知道你正在使用什么dbms,但这适用于sql server:
Select a."System_Name",
a."Comp_Mem_Pct",
b."CPU_Usage",
SUBSTR(a."Timestamp",2,2 )||'-'||SUBSTR(a."Timestamp",4,2)||'-'||SUBSTR(a."Timestamp",6,2) AS date_
from "ITMUSER"."Unix_Memory" a,
"ITMUSER"."SMP_CPU" b
where
a."System_Name"=b."System_Name"
and a."System_Name" in ('vil_amdox9:KUX','vil_ahmpumapp08_nsd:KUX')
and convert(smalldatetime, a."Timestamp",) > (SELECT DATEADD(day, -3, GETDATE()))
答案 1 :(得分:0)
将此添加到WHERE子句:
AND TIMESTAMP_FORMAT(a."Timestamp",'YYYYMMDDHH24:MI:SS'))
> CURRENT_TIMESTAMP - 3 HOUR