MariaDB INTERSECT OperatorINTERSECT Operator is used to return intersection of 2 or more tables. If a record exists in both tables, it will be included in the INTERSECT results. Otherwise, it will be omitted from the INTERSECT results. Syntax: Image representation Note: MariaDB does not suppoort INTERSECT operator but you can see the same thing by using IN operator to simulate the INTERSECT query as follows:Return Single Field using INTERSECT OperatorFollowing is a general query for INTERSECT operator but it will not be supoported in MariaDB. Use the following one: Output: It shows only common names between both the tables "Students" and "Student". INTERSECT Operator with WHERE ClauseFollowing is a general query for INTERSECT operator but it will not be supoported in MariaDB. Use the following syntax: Output: Note: You can also use INTERSECT operator with multiple expressions.Next TopicMariaDB Export |