select query unix timestamp 질문입니다.
글쓴이: lovethecorners / 작성시간: 수, 2007/02/21 - 12:54오전
database sarang.net에도 올렸는데, 제가 질문을 잘못한건지 아니면 방법이 없는것인지 답변이없어서 여기도 한번 올려봅니다.
예를 들어 다음과 같이 select를 해야 할경우에;
select max(b.mailing),max(b.mailingdate),c.closeddate from nl_mailing_stats a, nl_mailing_dates b, users c where a.mailing=b.mailing and a.id=c.id and a.id=$cur_ID_temp and a.mailing < $nl_mailing group by a.id
위와같이 select를 만들면 좋겠지만 여기서 문제는 max(b.mailingdate) 이부분입니다. mailingdate가 unix timestamp형식이아닌 date (2007-02-09)형식입니다. 이것을 위의 query에서 b.mailingdate를바로 unix timestamp로 변환후 select 하는 방법이 있을까요?
Forums:
DB마다 다른데요...
키워드를 보니 mysql같군요.
select UNIX_TIMESTAMP( max(b.mailingdate) ) FROM ...
=================
잠못자는 한솔아빠
고맙습니다.
고맙습니다. UNIX_TIMESTAMP를 그렇게 사용할수도 있는것을 알았습니다....-_-;
==
more than one way to do it
말로만 블로거: http://gojdweb.egloos.com
댓글 달기