Woody, thanks for the examples! Every time that I think a command in VFP is 'useless' someone shows me a cool use for it. Allways learning! Anthony
> -----Original Message----- > From: Juergen Wondzinski [mailto:woody /at/ prolib .DO.T de] > Sent: Friday, April 30, 2004 6:38 AM > To: profoxtech@leafe.com > Subject: AW: Where did 'Unique' index type go to? > > > Hi, > > A UNIQUE index is/was the dBase way of doing a SELECT DISTINCT. > Unfortunately, the name "unique" implies something like the > Primary Index to > most uneducated users, therefor MS decided to remove that > index from the > Dropdown. > > Examples for the usage? Easy: > > USE Customers > Index on country unique to temp.idx > Browse fields country > > Shows each country one time. Similar to : > SELECT DISTINCT Country FROM Customers ORDER BY Country. > > ------ > A more sophisticated usage for deduping data. Imagine you get > a whole bunch > of addresses from various sources and just append them all > into one big dbf. > You now ave to get this data to keep only one record for any address. > > SET DELE OFF > USE TheBigTable > DELETE ALL > INDEX ON Name + city + street UNIQUE to Temp.idx > RECALL ALL > BROWSE > > The trick is, that the Unique index processes only the very > first occurence > of the duplicate records, which then gets recalled. All other > duplicates > stay deleted and can get packed etc. > > > There are several other usages for UNIQUE, some of them provide a much > higher performance than the usual SQL variants. But I agree: UNIQUE is > nothing you wouldadd permanently to a table. It's for > one-time-usage only. > > > > Servus > > wOOdy > > |\_/| ---- ProLib - programmers liberty ----------- > (.. ) Our MVPs make the Fox run... See us > - / at www.prolib.de or www.AFPages.com > --------------------------------------------------- > Message entirely written using recycled electrons! > --------------------------------------------------- > > > > > [excessive quoting removed by server]
©2004 Anthony Testi |