473,626 Members | 3,467 Online
Bytes | Software Development & Data Engineering Community
+ 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~144 65368~MASTER LOCK COMPANY~56599
6375486.993~144 65368~MASTER LOCK COMPANY~56599
6381318.993~351 1209~HANOVER COMPRESSOR COMPANY
6381318.993~351 1209~HANOVER COMPRESSOR COMPANY
6389647.993~138 73252~SYMMETRIC OM INC~568136~56
6389647.993~138 73252~SYMMETRIC OM INC~568136~56
6421248.992~134 87262~EPC BUSINESS~568339 ~56847
6421248.992~134 87262~EPC BUSINESS~568339 ~56847
6421248.992~134 87262~EPC BUSINESS~568478 ~56833
6421248.992~134 87262~EPC BUSINESS~568478 ~56833
17765296.6~1055 1465~DANOSA~568 790~568879~Cust o
6423423.992~153 97472~JOHNSON DIVERSEY INC~5688
6423423.992~153 97472~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 1606
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
2070
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 detail records in the output file. The version I have is close to what I need except it concatenates two sets of header records in front of each merged detail record and the first two lines in the file and the last line is blank. Can someone please...
2
1925
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 table looks like this ClaimNum LineNum abcde1234561 abcde1234561
2
3984
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 blank fields, so each section of the report is the same size, my field is set to can grow/shrink, but I think my inclusion in the code for the calculated box of all 15 outcomes (I have no choice) is what's causing each calculated box to be the...
4
3401
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. class URopeBeamEmitter; class AAGP_GameInfo; class AAGP_Weapon; class ABaseScope; class AInfantryHUD; class UCamEffect_BlurOut; class URopeBeamEmitter;
1
3467
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> <Cell><Data>1</Data></Cell>
6
10300
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: "68586240","68586367","IRVING" "68586368","68586431","DENTON" "68586432","68586495","DENTON" and I want to become
5
3246
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 objRSEmail.MoveNext Loop
1
2224
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" except with a new makeup id. I created a form Makeup Copy with Line Subform. In the main form there is ID (key field), Comments, Customer, Description plus an unbound field "NewMakeup". Each line of the subform has the fields "Makeup (primary...
8
3845
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 2000 duplicates. Each duplicate contains the exact same data in every field except one, Field "Code", which may have "Agreed" or "Rejected". The second table, "Duplicate Coding" contains the correct field value for "Code" for the records which are...
0
8707
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.