home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 584 of 2,288   
   Anna C. Dent to bigbinc   
   Re: sql comparison and flag   
   25 Oct 03 14:57:54   
   
   From: anacdent@hotmail.com   
      
   bigbinc wrote:   
   > I need to compare two tables and print the differences(vbscript).  Is   
   > there a quick sql way to do this.  Otherwise I have a O(n^2) problem.   
   >   
   > What I am doing now is getting the data from the 2nd table first and   
   > then printing the 1st table and checking if the value matches the 2nd   
   > table. O(n^2)   
   >   
   > lets say I have ids   
   >   
   > Get Table 2 data   
   >   
   > 3 4 5   
   >   
   > Print Table 1 and Flag:   
   >   
   > 1   - no  O(n)   
   > 2   - no  O(n)   
   > 3   - yes O(n)   
   > 4   - yes O(n)   
   > 5   - yes O(n)   
   > 6   - no  O(n)   
   >   
   > Is there a better way?   
      
   Define better.   
      
   (SELECT * FROM TABLE1   
   MINUS   
   SELECT * FROM TABLE2)   
   UNION   
   (SELECT * FROM TABLE2   
   MINUS   
   SELECT * FROM TABLE1)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca