Using BREAK and NODUP for SQL PLUS Report
700604Jan 20 2010 — edited Jan 22 2010Hi all,
I have a SQL PLUS report with the following query:
SET termout OFF
set trimspool on
set echo off
set feedback off
SET linesize 30000
SET HEAD OFF
SET newpage 1
SET pagesize 9999
spool C:/Temp/Items_report.csv
Select '"Item'||'","'||
'Item Description'||'","'||
'User Item Type'||'","'||
'Manufacturer Name'||'","'||
'Manufacturer Part Number'||'","'||
'Category Set'||'","'||
'Category'||'","'||
'Created By'||'","'||
'Creation Date"'
From dual
UNION ALL
SELECT
'"'||msi.segment1||'","'||
msi.description||'","'||
fcl.meaning||'","'||
mm.manufacturer_name||'","'||
mfp.mfg_part_num||'","'||
mcst.category_set_name ||'","'||
mc.segment1 ||'","'||
fu.user_name||'","'||
msi.creation_date||'"'
from mtl_system_items_b msi
,fnd_common_lookups fcl
,fnd_user fu
,mtl_mfg_part_numbers mfp
,mtl_manufacturers mm
,MTL_ITEM_CATEGORIES MIC
,MTL_CATEGORY_SETS_TL MCST
,MTL_CATEGORY_SETS_B MCS
,MTL_CATEGORIES_B MC
Where msi.item_type = fcl.lookup_code
................................
.................................;
spool OFF
I want to use BREAK and NODUP command so as to eliminate duplicate values and to show only distinct values in the report.
Please help how can i use the command as i am able to use order by since i am using UNION ALL.
Please Help