Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

PostgreSQL DISTINCT

The PostgreSQL DISTINCT keyword is used in conjunction with SELECT statement to eliminate all the duplicate records and fetching only unique records.
There may be a situation when you have multiple duplicate records in a table. While fetching such records, it makes more sense to fetch only unique records instead of fetching duplicate records.
postgres=# SELECT name FROM tab1;           
 name  
-------
 nijam
 abu
 umar
 jamal
 abu
(5 rows)
-- From above table  tab1 having one duplicate values "name=ABU" is duplicate so DISTINCT  clause used to show without duplicate values. 
postgres=# SELECT DISTINCT(name) FROM tab1; 
 name  
-------
 umar
 jamal
 nijam
 abu
(4 rows)













Comments

Popular posts from this blog

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

PostgreSQL DOMAIN Data Type -2

10. Global Sequences

Oracle to Postgresql migration

How to Configure Oracle Dataguard and How to Perform Switchover and Failover