简体   繁体   中英

Error Code: 1052. Column 'id' in IN/ALL/ANY subquery is ambiguous

    Left join ( select * from crif_stage2 where id in 
    ( select id from  ( select user_id, max(id) as id from
    crif_stage2 group by 1)a)) cf2 on l.user_id = cf2.user_id

Edit: exactly where should I add table name (a) in this query?

Left join ( select * from crif_stage2 where id in ( select a.id from
( select user_id, max(id) as id from crif_stage2 group by 1) a ) ) cf2 on l.user_id = cf2.user_id

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM