PostgreSQL 新手(一般只有 6 个月的编程经验),遇到以下查询问题:
TutoringSession.where("extract (DOW from begin_time)
= extract DOW from (?)", Time.now)
给我以下错误消息:
ActiveRecord::StatementInvalid: PG::Error: ERROR: syntax error at or near "DOW"
LINE 1: ..." WHERE (extract (DOW from begin_time) = extract DOW from (...
^
: SELECT "tutoring_sessions".* FROM "tutoring_sessions" WHERE (extract (DOW from begin_time) = extract DOW from ('2012-04-18 14:39:58.202249'))
我浏览了 PostgreSQL 文档。有任何想法吗?