没懂啊,不过也写一句吧
select c1.id,select op_name from class_cache where op=c1.op1) as op1_name,
(select op_name from class_cache where op=c1.op2) as op2_name from class c1
select c1.id,select op_name from class_cache where op=c1.op1) as op1_name,
(select op_name from class_cache where op=c1.op2) as op2_name from class c1
from class a
join class_cache b on a.op1=b.op
join class_cache c on a.op2=c.op
(select op_name from class_cache where op=c1.op2) as op2_name from class c1
不好意思,少了个括号
select a.id,b.op_name as op1_name,c.op_name as op2_name from classs a
inner join class_cache b on a.op1=b.op
inner join class_cache c on a.op2=c.op
c1.id,
(select op_name from class_cache where op=c1.op1) as op1_name,
(select op_name from class_cache where op=c1.op2) as op2_name
from class c1
from class a
inner join class_cache b on a.op1=b.op
inner join class_cache c on a.op2=c.op
select a.id,op1_name=b.op_name,op2_name=c.op_name
from class a
left join class_cache b on a.op1=b.op
left join class_cache c on a.op2=c.op