473,466 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

To remove duplicate lines from the output

1 New Member
Hi,

Here is my query:
Expand|Select|Wrap|Line Numbers
  1. select a.out_tar||'~'|| a.out_csi_id||'~'||a.out_cust_name||'~'||a.out_id||'~'||b.out_id||'~'||a.out_category||'~'||
  2. b.out_category||'~'||
  3. to_char(a.out_start_date, 'fm dd-mon-yyyy hh24:mi') ||'~'||
  4. to_char(a.out_end_date, 'fm dd-mon-yyyy hh24:mi') ||'~'||
  5. to_char(b.out_start_date, 'fmdd-mon-yyyy hh24:mi') ||'~'||
  6. to_char(b.out_end_date, 'fmdd-mon-yyyy hh24:mi')||'~'||c.ots_inst_label  from
  7. out_flat_data_vw a,
  8. out_flat_data_Vw b,
  9. rca_flat_Data_Vw c where
  10. (a.out_tar=b.out_tar)
  11. and (a.out_tar=c.ots_tar)
  12. and (a.out_id!=b.out_id)
  13. and (a.out_type='Unplanned')
  14. and (a.out_csi_id=b.out_csi_id)
  15. and (a.out_Tar_type='TAR')
  16. and (a.out_scope='Individual')
  17. and (a.out_csi_id!='999999')
  18. and (b.out_start_date between a.out_start_Date and a.out_end_date)
  19. and (a.out_start_Date between '01-jul-07' and '01-aug-07')
  20. order by a.out_tar
  21. /
  22.  
I am getting an output in this format
===============================
6375486.993~14465368~MASTER LOCK COMPANY~56599
6375486.993~14465368~MASTER LOCK COMPANY~56599
6381318.993~3511209~HANOVER COMPRESSOR COMPANY
6381318.993~3511209~HANOVER COMPRESSOR COMPANY
6389647.993~13873252~SYMMETRICOM INC~568136~56
6389647.993~13873252~SYMMETRICOM INC~568136~56
6421248.992~13487262~EPC BUSINESS~568339~56847
6421248.992~13487262~EPC BUSINESS~568339~56847
6421248.992~13487262~EPC BUSINESS~568478~56833
6421248.992~13487262~EPC BUSINESS~568478~56833
17765296.6~10551465~DANOSA~568790~568879~Custo
6423423.992~15397472~JOHNSON DIVERSEY INC~5688
6423423.992~15397472~JOHNSON DIVERSEY INC~5688

Here most of the rows are duplicate like first 2 rows. Data is same, but output has come twice. How to get only one output?
Jul 23 '07 #1
2 1591
debasisdas
8,127 Recognized Expert Expert
You are getting exactly what you have asked for in the query.
Jul 23 '07 #2
rajanbabu23
4 New Member
Try it....
Expand|Select|Wrap|Line Numbers
  1. select DISTINCT a.out_tar||'~'|| a.out_csi_id||'~'||a.out_cust_name||'~'||a.out_id| |'~'||b.out_id||'~'||a.out_category||'~'||
  2. b.out_category||'~'||
  3. to_char(a.out_start_date, 'fm dd-mon-yyyy hh24:mi') ||'~'||
  4. to_char(a.out_end_date, 'fm dd-mon-yyyy hh24:mi') ||'~'||
  5. to_char(b.out_start_date, 'fmdd-mon-yyyy hh24:mi') ||'~'||
  6. to_char(b.out_end_date, 'fmdd-mon-yyyy hh24:mi')||'~'||c.ots_inst_label from
  7. out_flat_data_vw a,
  8. out_flat_data_Vw b,
  9. rca_flat_Data_Vw c where
  10. (a.out_tar=b.out_tar)
  11. and (a.out_tar=c.ots_tar)
  12. and (a.out_id!=b.out_id)
  13. and (a.out_type='Unplanned')
  14. and (a.out_csi_id=b.out_csi_id)
  15. and (a.out_Tar_type='TAR')
  16. and (a.out_scope='Individual')
  17. and (a.out_csi_id!='999999')
  18. and (b.out_start_date between a.out_start_Date and a.out_end_date)
  19. and (a.out_start_Date between '01-jul-07' and '01-aug-07')
  20. order by a.out_tar
  21. /
  22.  
Jul 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Luke Airig | last post by:
I am trying to merge two xml files based on common date/time and then write out a tab-delimited xml file with the header record from one of the input files concatenated in front of the merged...
2
by: Pablo | last post by:
Hello, there, I have a table tblData which has pharmacy data. The table has following fields: ClaimNum, LineNum... The ClaimNum has claim number which is 12 characters. LineNum is NULL. The...
2
by: Olveres | last post by:
Hi, I have managed to work out how to add new lines into a calculated text box. However in this text box some of the outcome fields are empty however when previewing the report it includes the...
4
by: whatnameisnottaken | last post by:
right now i have gotten all the classes to print out using helpdbg. Now i want to remove the duplicate class names out of an array so i can just print one of each. This is the output i have. ...
1
by: tosachinji | last post by:
Hi I am new to xslt. Could you please tell me, how can we remove duplicate records from a xml file. Here is the xml file: <Row> <Cell><Data>Active</Data></Cell> <Cell><Data>D</Data></Cell>...
6
by: topala1984 | last post by:
hello all excuse my english, I`m a beginer in java and I want to remove duplicate cities + rearrenging file`s lines elements from one 150 mb file, in my file I have that: ...
5
by: lyne_asp | last post by:
Hello everbody, Please help me to remove the duplicate value. I have this code Do until objRSEmail.eof tgroup = objRSEmail("tEmailName")&"@city.com;"&tgroup ...
1
by: VinArt | last post by:
MS Acc 2003, XP Thank you in advance for any help. I have tables called "Makeup" and "Lines". Each makeup can have multiple lines. Goal is to create a new "makeup" with identical "lines"...
8
natalie99
by: natalie99 | last post by:
hi everyone i have reseached this topic and cannot seem to find a solution that suits my problem, please help!! I have two tables, "Inventory" which contains 30,000 or so records, with about...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.