Follow us: Connect on YouTube Connect on YouTube Connect on YouTube

Pages

Sunday, 9 April 2017

How to get distinct values in table value set




Method1:


While creating table value set write your SQL statement directly in the place of table name but don’t miss to use distinct and alias name for SQL statement as shown below

distinct value set



Method2:


Build Query with rowid to avoid the duplicate values 

Syntax:
SELECT COLUMN_NAME
  FROM TABLE_NAME T1
 WHERE ROWID = (SELECT MAX (ROWID)
                  FROM TABLE_NAME T2
                 WHERE T1.ID = R2.ID)


Method3:


Create view to get distinct values and use the same view while you are creating table value set.

Example:

Create view EMP_V as select distinct deptno from emp;




Method4:


While creating value set ,check the check box “Allow Parent Values” as shown below screenshot.


Table value set allow parent values

Share this article :

0 comments:

Post a Comment