我需要一点帮助。我需要这个查询
SELECT *, STR_TO_DATE( end_date, "%d/%m/%Y" ) AS DATE
FROM `resume_experience`
WHERE `resume_id` =1
ORDER BY DATE DESC
以codeigniter活动记录格式编写。这是我写的。
$result = $this->db->select('*,STR_TO_DATE(end_date,%d/%m/%Y) AS DATE')
->from('resume_experience')
->order_by('DATE', "desc")
->where($where)
->get()
->result_array();
return $result;
它给了我以下错误。
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 2 行的 'FROM ( resume_experience
) WHERE resume_id
= '1' ORDER BY DATE
desc'附近使用正确的语法
SELECT *, STR_TO_DATE(end_date, `%d/%m/%Y)` AS DATE FROM (`resume_experience`) WHERE `resume_id` = '1' ORDER BY `DATE` desc
任何帮助将不胜感激。
感谢和等待,
艾哈迈德