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;


Comments

Popular posts from this blog

Oracle Database 19C Performance Tunning - PART 1

Oracle Patching Using Opatch Utility

Oracle RMAN Backup And Restore

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

Pg_pool-II Installation and Configuration