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:
RE: shrink-wrapped version out yet? (1997)
questions on variations of Ken's [text (1999)
Missing Cart Information (2003)
[AppendFile] problem (WebCat2b13 Mac .acgi) (1997)
Version 4? (2000)
Generating unique SKU from [cart] - Still Stumped... (1997)
Show items based on login Password (2003)
OT - Public Upload Security (2002)
Training Tapes Improved (1998)
emailer (1997)
Support ?? (1997)
Extended [ConvertChars] (1997)
Plugin or CGI or both (1997)
Anyone get webdna to run on apache 2.x on osx? (2006)
How to Sort Summ data ? (1997)
WebCommerce Security Alert! (1996)
Re[2]: 2nd WebCatalog2 Feature Request (1996)
WebCat2: Items xx to xx shown, etc. (1997)
Cookie woes with Mac IE4 (1998)
searching twice on same field (1998)