-1

SQL Server 2008 に ,timestamplog which contains one column of name LogTime of typeINTEGER`というテーブルがあります

値は次のようになります。

1350468610,
1350468000,
1350381600,
1350295810

13504686091350468001..の間の値が必要です。

これらの値を照会する方法を教えてください。

次のクエリを試しました

select LogTime 
from timestamplog 
where LogTime between 1350468609 and 1350468001

select LogTime 
from timestamplog 
where LogTime >= '1350468610' and  LogTime <= '1350468000'

select LogTime 
from timestamplog 
where LogTime >= convert(decimal, 1350468610) and LogTime <= convert(decimal,1350468000)

select LogTime 
from timestamplog 
where LogTime >= convert(varchar, 12) and LogTime <= convert(varchar, 14)

でも列が来ない…

実際、テーブル内の値は、テーブルに保存されているタイムスタンプ値ですINTEGERTIMELOG

IMP 注: table に 12,13,14 のような値が含まれている場合、上記のクエリが正常に機能しているとします。しかし、長さ10の数を比較しているとき、クエリは値を取得しません

前もって感謝します

4

1 に答える 1

2

1350468001 は 1350468609 より小さいため、順序を逆にすると、どのクエリも機能します。私は一緒に行きます...

select LogTime from timestamplog where LogTime between 1350468001 and 1350468609

これは包括的な範囲です。

于 2012-10-17T07:31:33.113 に答える