Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 remove duplicates from iteration problem

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Podge Posted - 23 March 2010 : 11:32:06
I have two tables in a database. The first contains rows of string data that I want to compare against itself. The second stores the results.

Table Name APP.ABC
ID
StringData

Table Name APP.RESULTS
ID
StringData_A_ID
StringData_B_ID
Result

I am iterating over the data comparing each row of StringData to each other row of StringData using the following two SELECT statements;

Outer iteration
SELECT ID, StringData FROM APP.ABC

Inner Iteration
SELECT ID, StringData FROM APP.ABC where ID != " + String_A_ID

String_A_ID & String_B_ID hold the ID's of the Strings to be compared.

Strings are not compared to themselves because of the second SELECT statement above however I think I can halve the amount of processing necessary if I can remove duplicate comparisons. These are ID's for sample results (with the actual result removed);

AB
12 (String ID 1 compared to String ID 2)
13
14
15
21 (String ID 2 compared to String ID 1)
23
24
25
etc.

The two lines in red above are duplicates of each other and I only need the first one. How can I prevent the second comparison using a join on the RESULTS table in either of the SELECT statements above?

Any other ideas ?

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000 Version 3.4.07