gpt4 book ai didi

Mysql别名内连接链问题

转载 作者:行者123 更新时间:2023-11-29 18:07:24 24 4
gpt4 key购买 nike

我有以下查询

select *
from
reservation r,
(
assignment a
INNER JOIN class_ c ON a.class_id = c.uniqueid
INNER JOIN scheduling_subpart ss ON c.subpart_id = ss.uniqueid
INNER JOIN instr_offering_config ioc ON ss.config_id = ioc.uniqueid
) as io
where
io.solution_id in (32931842) and
io = r.offering_id

注意:solution_id 是分配表上的列。

我希望括号中的 who 内部连接使用 io 别名,但出现语法错误:

Check the manual that corresponds to your MySQL server version for the right syntax to use near 'as io where io.solution_id in (32931842) and io = r.offering_id'

最佳答案

看起来您的意思是这样做:

select *
from
reservation r,
(
select * from assignment a /// You missed the select * from
INNER JOIN class_ c ON a.class_id = c.uniqueid
INNER JOIN scheduling_subpart ss ON c.subpart_id = ss.uniqueid
INNER JOIN instr_offering_config ioc ON ss.config_id = ioc.uniqueid
) as io
where
io.solution_id in (32931842) and
io = r.offering_id

关于Mysql别名内连接链问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47715397/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com