mysql command line client에서 테스트는 이미 완료했는데요...
select id,name,modelnumber,series,content,date_format(writedate,'%y-%m')from products;
이쿼리가 잘실행됩니다.
node.js로 하고있는데요
로직부분 js파일에서
client.query("select id,name,modelnumber,series,content,date_format(writedate,"+'%y-%M'+")from products",function(error,results){
이안에서 res.render로 페이지로 select 쿼리 결과 results를 전달해줍니다.
여기서 date_format써서 년-월 이런식으로 표시하고 싶은데 ' 처리를어떻게 해야할지모르겠습니다.]
errorError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%y-%M)from products' at line 1
이런식으로 에러가납니다.
date_format(writedate,'%y-%M')
이렇게하면 writedate 데이터가 아예안나오고...
date_format(writedate, %y-%M)
하면 똑같은에러나오고...
조언좀주세요 ㅜㅠ
아. 또하나. %M하면 영어로 달이 January이렇게 나오고 %m이러면 01로나오는데요, 혹시 한글로 나오게 하거나 하는 방법이 따로있을까요?