Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing 2 tables; getting list of missing records
Message
 
 
To
01/08/2005 10:27:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01037464
Message ID:
01037467
Views:
39
This message has been marked as the solution to the initial question of the thread.
Malcolm,

Try
* LEFT JOIN
select curWord.cWord from curWord ;
	LEFT JOIN curDictionary ;
		ON curDictionary.cWord = curWord.cWord ;
	WHERE curDictionary.cWord IS NULL ;	
	into cursor curMisspelled

* Correlated subquery
select curWord.cWord from curWord ;
	where NOT EXISTS ( select * from curDictionary ;
				WHERE curDictionary.cWord = curWord.cWord ) ;
	into cursor curMisspelled



>I'm looking at potential ways to speed up the performance of Craig Boyd's recently posted free VFP spellchecker class (check it out!)
>
>http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,8800bdb9-a9c2-484f-942f-6a08947d903a.aspx
>
>My thought was to build a cursor of all words in a block of text and compare that cursor to a cursor containing a list of all words in a dictionary. The result should be a list of misspelled words.
>
>To keep things simple, assume both cursors have a single field called cWord of the same length and that all words are lowercase. What is the most efficient way to compare my curWords to curDictionary to get a list of all words in curWords that are not in curDictionary?
>
>Here's my first pass:
>
>
>
>select cWord from curWord ;
>  where curWord.cWord not in ( select cWord from curDictionary ) ;
>  into cursor curMisspelled
>
>
>
>Any suggestions welcome. Also be sure to check out Craig's free spellchecker class!
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform