我有 2 个表,其值如下:
**tbl_users**
user_ID name
1 somename1
2 somename2
3 somename3
**tbl_interviews**
int_ID user_ID answer date
1 1 sometextaba 2012-11-04
2 2 sometextxcec 2012-10-05
3 1 sometextabs 2011-06-04
4 3 sometextxcfc 2012-11-04
5 3 sometextxcdn 2012-11-04
现在.. 我应该算上今年和前几年接受采访的人。不幸的是,我什至无法选择它们..我正在尝试这样的事情..但它不起作用(不抛出语法错误但给出空结果):
SELECT * FROM interviews WHERE ('YEAR(date) = 2012' AND 'YEAR(date) < 2012')