You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have one scenario to find only records with maximum sequence, the SQL I want to achieve is:
select
order.*,
account.account_namefrom order
join account onaccount.account_id=order.account_idjoin (
select order_key, max(item_seq) as`max_item_seq`from order
group by order_key
) t2 ont2.order_key=order.order_keyandt2.max_item_seq=order.item_seq
The rendered SQL in the selectStatementProvider will be like:
select*,
account.account_namefrom order
join account onaccount.account_id= account_id
# ...omit the rest
All the columns from table order lose the table alias and this is causing ambiguous issue, the interesting thing is when I remove the sub-query join condition, everything is working fine, the rendered SQL contains table alias of main table.
Could you help on this?
The text was updated successfully, but these errors were encountered:
Hi Team,
I have one scenario to find only records with maximum sequence, the SQL I want to achieve is:
And in Java code:
The rendered SQL in the
selectStatementProvider
will be like:All the columns from table
order
lose the table alias and this is causing ambiguous issue, the interesting thing is when I remove the sub-query join condition, everything is working fine, the rendered SQL contains table alias of main table.Could you help on this?
The text was updated successfully, but these errors were encountered: