Php 尝试打开表时出现未知列错误
因此,在运行下面的查询之后,每当我试图打开受影响的表时,它都会显示“order子句中的未知列doc.section”。我仍然可以对上述表运行查询,但我无法再使用phpmyadmin上的左面板访问该表 查询:Php 尝试打开表时出现未知列错误,php,mysql,sql,Php,Mysql,Sql,因此,在运行下面的查询之后,每当我试图打开受影响的表时,它都会显示“order子句中的未知列doc.section”。我仍然可以对上述表运行查询,但我无法再使用phpmyadmin上的左面板访问该表 查询: select pending.* from ( select distinct doc.*, users.dept_id from list_users users, exit_doc doc inner join ( select q.sectio
select pending.*
from (
select distinct doc.*, users.dept_id
from list_users users, exit_doc doc
inner join (
select q.section,
max(q.subsection) subsection
from exit_doc q
group by q.section ) latest
on doc.section = latest.section
and doc.subsection = latest.subsection
where doc.user_id = users.user_id) pending
inner join (
select approvers.dept_id, approvers.role_code
from approvers
where user_id = 10004
and delete_flag = 0) user
on pending.next_user = user.role_code
and pending.dept_id = user.dept_id
我的查询是否影响了表的结构?错误是order子句上的unknown列,但我在查询中没有使用任何order?您是否尝试清除浏览器的cookie和缓存?不要混合显式联接和隐式逗号分隔联接。我不太明白,您能详细说明吗?从列表用户中,退出\u doc doc-bad,从列表中_usersusers join exit _docon doc.user\u id=users.user\u id-更好。用户和文档是两个不同的表,由第三个名为lates的“表”连接。您的查询没有排序依据,因此不会生成您提到的错误。