目前我有这个查询
SELECT SESSIONID, SESSIONDATE, CONCAT ('$', SESSIONPRICE)
FROM SESSIONS
WHERE SESSIONDATE = (%-JUN-%);
这不能做我想做的事情,我希望它检查会话日期是否在6月份。我该怎么做?
答案 0 :(得分:0)
SELECT SESSIONID, SESSIONDATE, CONCAT ('$', SESSIONPRICE)
FROM SESSIONS
WHERE SESSIONDATE like '%-JUN-%';
答案 1 :(得分:0)
试试这个:
SELECT SESSIONID, SESSIONDATE, CONCAT ('$', SESSIONPRICE)
FROM SESSIONS
WHERE EXTRACT( MONTH FROM `SESSIONDATE ` ) = 6