Tuesday, December 02, 2008

DB2 SQL - Select Distinct

Select Distinct is used to ensure that data retrieved from a query will not display duplicate records. It is useful if you want to get a list of users list of names from a database. The format of the sql is SELECT DISTINCT column-name.

Here's an example :
SELECT DISTINCT GRANTEE FROM SYSIBM.SYSTABAUTH WHERE GRANTEETYPE <> 'P';

0 Comments:

Post a Comment

<< Home