使用set编写正确的mysql查询

ezykj2lf  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(242)

我有以下疑问:

select count(*)
from @table := (
    select table_name
    from information_schema.TABLES
    where table_schema = 'sbnp_phalanx_queue'
    order by CREATE_TIME desc
    limit 1
)
where mtime < DATE_SUB(Now(), INTERVAL 3 DAY);

但我有个错误:
错误1064(42000):您的sql语法有错误;请查看与您的mysql服务器版本对应的手册,以获取在“@table=”附近使用的正确语法(从第1行的information\u schema.tables中选择table\u name,其中table\u schema=”
如何正确执行?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题