在mysql中写入cte时出错

zqry0prt  于 2021-06-18  发布在  Mysql
关注(0)|答案(0)|浏览(152)

我在mysql中有下面的查询,但是当我执行它时,我得到一个语法错误消息:
sql语法有错误;检查与您的mysql服务器版本对应的手册,以获得正确的语法,使用near'with cte1 as(在第1行选择u.firstname,dayname(t.date)as day,date\ u format(t.date,“')

WITH CTE1 AS
(
select u.FirstName,dayname(t.date) as Day, Date_Format(t.Date,"%Y-%m-%d") As Date,  t.subtask,
IF(subtask='PTO','PTO', hours) as Emphours,

 g1.name
 from user U, task t, groupuser g, `group` g1
where  U.idUser= t.userid and g.userid= U.idUser
and g1.name='Lam-techM' and date >= '2018-11-01' and date <= '2018-11-08'
order by  date asc
)
select * from CTE1;

有人能帮我吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题