当我收到错误错误代码:1248 时,我正在这样做。每个派生表都必须有自己的别名,任何人都可以帮助我,为什么会出错?

侨黄健
 SELECT a.telegram_name, a.full_name, a.role_id, a.user_id 
        from tbl_telegram_user a 
         LEFT JOIN ( 
        select a.owner_id, a.owner_name from tbl_agenda as a
        join ( 
         select a.type, a.message, a.status from tbl_message as a 
        join tbl_status as b 
        join (select * from tbl_agenda as a join tbl_message as b
         on a.type = b.type
         where a.type="/mom" and ( current_date BETWEEN from_time and to_time ) is not null)
        on a.status = b.status 
        where b.status_type = 'workLocation' or b.status_type = 'off') as b
     on a.type = b.type 
         where DATE(a.from_time) = DATE('2021-08-10 21:04:02')) as b 
         on a.telegram_name = b.owner_name 
         where b.owner_name is null AND a.user_id <> 0 
舒巴姆

我认为在第 9 行你忘记了别名:

SELECT a.telegram_name, a.full_name, a.role_id, a.user_id from tbl_telegram_user a LEFT JOIN ( select a.owner_id, a.owner_name from tbl_agenda as a join ( select a.type, a.message, a.status from tbl_message as a join tbl_status as b join (select * from tbl_agenda as a join tbl_message as b on a.type = b.type where a.type="/mom" and ( current_date BETWEEN from_time and to_time ) is not null) as "your alias" on a.status = b.status where b.status_type = 'workLocation' or b.status_type = 'off') as b on a.type = b.type where DATE(a.from_time) = DATE('2021-08-10 21:04:02')) as b on a.telegram_name = b.owner_name where b.owner_name is null AND a.user_id <> 0

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章