Re: search for non-unique question
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 40357
interpreted = N
texte = You've gotta keep reading beyond the lines you commented on and see what happens the next time through the loop...After the [/showif], the value of lastNickName is changed to the nickname in the current record. The next pass through the [founditems] loop, lastNickName is equal to the nickname from the previous record. If it matches the nickname in the new record, then we have a duplicate. This will find all the duplicates because we sorted the records by nickname, so all matching records will be grouped together.Walking through the example...Given the following nicknames (after sorting):alicebobbobfredThe first pass through, the showif resolves to [showif alice=] which is false, so no duplicate. Set lastnickname to alice.The second pass through, the showif resolves to [showif bob=alice] which is false, so no duplicate. Set lastnickname to bob.The third pass through, the showif resolves to [showif bob=bob] which is true, so bob is a duplicate - report it, change it, or whatever you need to do. Set lastnickname to bob (again).The fourth pass through, the showif resolves to [showif fred=bob] which is false, so no duplicate. Set lastnickname to fred.Make sense now?- BrianAt 6:28 PM -0800 11/26/2001, Aaron Lynch wrote:>This makes no sense to me:>>>On 11/26/01 9:15 AM, Brian Fries mashed the following keys :>>> Faster than doing 10,000 searches:>>>> [text]lastNickName=[/text]>>OK, so now lastNickName = ''>>> [search>> db=database.db&neNickNamedata=[blank]&allhit=1&asNickNamesort=1][founditems]>>OK, you just did a search, with 10,000 results...>>> [showif [url][NickName][/url]=[url][lastNickName][/url]]>>If 'nick'='' ?? This will only tell you if it's blank, which it won't be>cuz you are searching for non blank entries.>>>> ** [NickName] ** is duplicated>> [/showif]>> [text]lastNickName=[NickName][/text]The above line now sets lastNickName to the NickName in the currently found record. The next time> > [/founditems][/search]>>>> - brian>>>> At 11:54 AM +0000 11/24/2001, Dale Therio wrote:>>> WebCatalog 3.0.7 on Mac OS>>>>>> Hello,>>>>>> I have a database with about 10,000 records in it. I need to do a>>> search on a specific field (nickname) and find all records that have>>> more than one match.>>>>>> What I am doing is trying to take an existing field and eventually>>> make the value in that field a unique value, so in order to do that>>> I need to find all records where there is a conflict and notify>>> those users that they will need to change their nickname.>>>>>> Got any ideas on how to construct such a search?>>>>>> Oh, and many of the records currently have this field blank, I will>>> deal with those users as a seperate case.>>>>>> Thanks for any suggestions.>>>>>> Dale> >>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
You've gotta keep reading beyond the lines you commented on and see what happens the next time through the loop...After the [/showif], the value of lastNickName is changed to the nickname in the current record. The next pass through the [founditems] loop, lastNickName is equal to the nickname from the previous record. If it matches the nickname in the new record, then we have a duplicate. This will find all the duplicates because we sorted the records by nickname, so all matching records will be grouped together.Walking through the example...Given the following nicknames (after sorting):alicebobbobfredThe first pass through, the showif resolves to [showif alice=] which is false, so no duplicate. Set lastnickname to alice.The second pass through, the showif resolves to [showif bob=alice] which is false, so no duplicate. Set lastnickname to bob.The third pass through, the showif resolves to [showif bob=bob] which is true, so bob is a duplicate - report it, change it, or whatever you need to do. Set lastnickname to bob (again).The fourth pass through, the showif resolves to [showif fred=bob] which is false, so no duplicate. Set lastnickname to fred.Make sense now?- BrianAt 6:28 PM -0800 11/26/2001, Aaron Lynch wrote:>This makes no sense to me:>>>On 11/26/01 9:15 AM, Brian Fries mashed the following keys :>>> Faster than doing 10,000 searches:>>>> [text]lastNickName=[/text]>>OK, so now lastNickName = ''>>> [search>> db=database.db&neNickNamedata=[blank]&allhit=1&asNickNamesort=1][founditems]>>OK, you just did a search, with 10,000 results...>>> [showif [url][NickName][/url]=[url][lastNickName][/url]]>>If 'nick'='' ?? This will only tell you if it's blank, which it won't be>cuz you are searching for non blank entries.>>>> ** [NickName] ** is duplicated>> [/showif]>> [text]lastNickName=[NickName][/text]The above line now sets lastNickName to the NickName in the currently found record. The next time> > [/founditems][/search]>>>> - brian>>>> At 11:54 AM +0000 11/24/2001, Dale Therio wrote:>>> WebCatalog 3.0.7 on Mac OS>>>>>> Hello,>>>>>> I have a database with about 10,000 records in it. I need to do a>>> search on a specific field (nickname) and find all records that have>>> more than one match.>>>>>> What I am doing is trying to take an existing field and eventually>>> make the value in that field a unique value, so in order to do that>>> I need to find all records where there is a conflict and notify>>> those users that they will need to change their nickname.>>>>>> Got any ideas on how to construct such a search?>>>>>> Oh, and many of the records currently have this field blank, I will>>> deal with those users as a seperate case.>>>>>> Thanks for any suggestions.>>>>>> Dale> >>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Brian Fries
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
no template caching (1997)
WCS Newbie question (1997)
Bugs in IE 6.0 ? (2003)
Moment of Thanks (1997)
[WebDNA] Installation problems for IIS 6 (2010)
Closing db's & caching templates (was: Shippingcalculations) (1997)
Paths (1998)
Follow-Up to: Removing [showif] makes a big difference in speed (1997)
Bannerad Demo (1998)
Plaintext Email Attachment (2001)
Database Security Rev., (2002)
Next X hits (1996)
[tcpconnect] doing nothing (2001)
Ampersand (1997)
Mondo amounts of Mail [long] (1999)
value in forms (2000)
Hyperboard users wanting a quoted message (1998)
Kanji in http requests (1998)
Sort Order on a page search (1997)
Log-in Scheme (2003)