프로그래밍 노트

Firebird의 Timestamp에서 특정 년이나 월이나 일만을 검색하는 방법 본문

데이터베이스/Firebird

Firebird의 Timestamp에서 특정 년이나 월이나 일만을 검색하는 방법

띠리 2009. 1. 8. 10:11
Firebird의 Timestamp에서 특정 년월일만을 검색하는 방법

select * from testLOG
where
    extract(year from logStamp) > 2007 and
    extract(month from logStamp) = 1 and
    extract(day from logStamp) < 10 and

extract를 사용하면 TIMESTAMP형 필드에서 년,월,일에 대해 검색하기가 쉬워진다.
Comments