You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/04/23 04:06:04 UTC
[GitHub] [shardingsphere] xianshun163 commented on issue #9993: Can not find owner from table
xianshun163 commented on issue #9993:
URL: https://github.com/apache/shardingsphere/issues/9993#issuecomment-825370480
I have the same error by the follow 2 sql:
----sql1:
select i.item_cd,item_name from
( select o.order_id as id, o.order_name as name,it.item_id from
( select * from t_order o where order_id=1 order by order_id ) o
left join
( select * from t_order_item it where order_id=1 order by order_id ) it
on (o.order_id=it.order_id and o.user_id = it.user_id)
) tp
left join t_order_item i
on (tp.item_id=i.item_id)
----- sql2:
select o.id, o.name,it.item_id from
( select order_id as id, order_name as name,user_id
from t_order --- with a alias name o here, it will work
where order_id<5 and order_id>0 and order_id=1 order by order_id ) o
left join
t_order_item it
on (o.id=it.order_id and o.user_id = it.user_id)
-------------
as the sql1, “on (tp.item_id=i.item_id)” , it will use tp to find a reall table name, but it cannot find.
I have try to modify the code myself, to fix the issue, when it cannot find the reall table , I make a second try, and from the sqlstatement object to match the table.
It works, but it's not elegant.
Hope to solve this problem from the bottom design.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org