PostgreSQL Set Operators

operator to combine result sets of multiple queries into a single result sets.

  • union
  • union all
  • intersect
  • except

Union Examples:

pearl=# select id from siva union select id from muthu;

Union all Examples:

pearl=# select id from siva union all select id from muthu;

Intersect Examples:

pearl=# select id from siva intersect select id from muthu;

Except Examples:

pearl=# select id from siva except select id from muthu;
pearl=# select id from muthu except select id from siva;


Popular posts from this blog

Oracle Database 19C Performance Tunning - PART 1

Oracle RMAN Backup And Restore

Oracle Patching Using Opatch Utility

Welcome to DBA Master – Database Tips, Tricks, and Tutorials

Oracle 19c Database Software Installation in OEL8

PostgreSQL Triggers

PostgreSQL Opensource Installation in RHEL or Oracle Linux(OEL) 8 and above

PostgreSQL Cursor

PostgreSQL Procedures

PostgreSQL User & Role Management