问题遇到的现象和发生背景
mysql8.0.28 用的是datagrip,用intersect求交集一直报错,提示语法错误,但是,实在没找到
问题相关代码,请勿粘贴截图
select sname from Test.student where sdept = '信息院'
intersect
select sname from Test.student where sage <= 19;
运行结果及报错内容
[42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'intersect select sname from Test.student where sage <= 19' at line 2