lava-oushudb-dt-sql-parser/test/parser/mysql/syntax/fixtures/interSect.sql
琉易 428d851913
feat: #190 improve mysql grammer (#196)
* refactor: generic rename to mysql

* refactor: g4 with mysql syntax

* test: mysql syntax

* refactor: remove useless keywords

* refactor: remove nonReserved keywords

* refactor: lint specificFunction

---------

Co-authored-by: liuyi <liuyi@dtstack.com>
2023-11-27 15:25:40 +08:00

13 lines
496 B
SQL

-- https://dev.mysql.com/doc/refman/5.7/en/intersect.html
/* query_expression_body INTERSECT [ALL | DISTINCT] query_expression_body
[INTERSECT [ALL | DISTINCT] query_expression_body]
[...]
query_expression_body:
See Section 13.2.14, “Set Operations with UNION, INTERSECT, and EXCEPT” */
(SELECT * FROM table_name1) INTERSECT (SELECT * FROM table_name2);
SELECT column_list FROM table_a WHERE age = 12 INTERSECT SELECT column1, COUNT(column2) FROM table_name GROUP BY column1;