Can you tell what are the different set operations available in MySQL?

Posted by Prem Tiwari | Updated on

The various set operations available in MySQL are as follows:

  • UNION – This operation returns all the distinct rows selected by a query
  • UNION ALL – This operation returns all the rows selected by a query and also includes all duplicate rows.
  • MINUS – This operation returns all the distinct rows selected by the first query but does not select the rows selected by the second query.
  • INTERSECT – This operation returns all the distinct rows selected by both queries.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers