Navicat中mysql版本低,不支持with as 语句怎么办?

Navicat中mysql版本低,不支持with as 语句怎么办?_第1张图片

将with as 语句换成 创建临时表语句

create  temporary table a (SELECT * FROM sms_record
WHERE mobile = '15810539987'
AND app_id = 'trade'
AND app_name = 'trade'
AND message LIKE '短信通道组测试%'
AND sent_time > '2021-09-09 14 : 30 : 00')

select * from a

with as 和 temporary 一个道理,都是将公用部分放到临时表中

你可能感兴趣的:(MYSOL,mysql,sql)