Re: Compound index and unique

From: Fred Taylor (ftaylor_at_mvps.org!REMOVE)
Date: 02/19/05


Date: Sat, 19 Feb 2005 11:00:31 -0700

Forget about using a UNIQUE index, you're just asking for trouble and/or
corruption.

If you need a list for display purposes, then do a SQL SELECT using the
MIN() SQL function:

SELECT item,MIN(yourdate) FROM yourtable GROUP BY item INTO CURSOR
somecursor

-- 
Fred
Microsoft Visual FoxPro MVP
"Charles" <clsuhr@cox.net> wrote in message 
news:t8oe11t1pr4edok6hpdm0tb069a4lm4pe4@4ax.com...
> Having a problem getting a unique item and a min date for that object.
> Any suggestions.  I have a cursor with a number of items (repeat
> several times with different dates.  Need to be able to get a list of
> item so the only appear once and have the earliest date.  I'm at a
> lost with the except of during a sort to a database and then doing a
> unique index.  But don't want to have to resort to that for speed
> reasons.  I'm running visual fox pro 6.
>
> Thanks Charles 


Relevant Pages

  • Re: NULLs
    ... Can you tell us what part of the SQL '92 standard it says this? ... SQL> create unique index unq_allnulltest on allnulltest ...
    (comp.databases.oracle.server)
  • Re: Duplicating data in continuous subform linked to SQL
    ... tables to a SQL 2008 DB that was upsized with Access 2003 to SQL 2005 then ... have a primary key or that Access has some trouble finding it or using it; ... using this second unique index as the primary key. ... you should take a look with the SQL-Server Profiler to see ...
    (microsoft.public.access.adp.sqlserver)
  • Re: join tables sequencialy
    ... i have 2 tables with the exact field structure and names, ... One thing that may not be obvious: there is *nothing* magical about SQL. ... local table in Access with the same 240 fields; you can set a unique Index on ... you can remove the duplicates later if need be. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Unique Columns
    ... right clicked on the field and selected Indexes/Keys ... The SQL has an ID but would also like to have another ... CREATE UNIQUE INDEX IX_tablename_columnname_U ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: Creating a sqlce index in code?
    ... You can add UNIQUE (create unique index) and/or sort order for columns ... (ASC/DESC) ... See SQL CE Books Online for more information (available if you install SQL ...
    (microsoft.public.dotnet.framework.compactframework)