2

特定の時間と分を含むフィルターを使用してすべての行を検索する必要があります。

例:

26/05/2009 - 16:00
26/05/2009 - 17:00
10/11/2009 - 09:00
10/11/2009 - 10:00
10/11/2009 - 11:00
10/11/2009 - 12:00

時間/分が「17:00」と「18:00」のすべての行が必要です。また、日付はオプションのフィールドです。

これを行う方法がわかりません。「sqlanywhere11」を使用しています。

4

2 に答える 2

4

http://manuals.sybase.com/onlinebooks/group-pbarc/conn5/sqlug/@Generic__BookTextView/23220;pt=23220;uf=0を参照してください

select  *
from    tab
where   datepart( hour, date_col )  in (17,18)
and     datepart( minute, date_col ) = 0
and     datepart( second, date_col ) = 0
于 2010-02-02T12:04:32.090 に答える
1

別のオプションは次のとおりです。

select * from tab where convert(time,date_col) in ( '17:00','18:00')

于 2010-02-03T05:45:19.980 に答える