Re: Finding Duplicate rows
Posted in 2007
On Jul 12, 5:00 am, WA <wakt...@gmail.com> wrote:
> Hi,
>
> I have a table which nobody knows anything about except that it
> contains some important data which needs to be displayed in a report.
> The problem I have is that I dont quite know which field(s) are the
> key(s).
>
> Can anyone supply some sql which I can use to see if there are
> duplicates?
> I only have access to Informix from Microsoft SQL Server Management
> Studio Express Query using openquery statements.
> I have been told that maybe there are three fields within this table
> that make up the key but they are not sure.
> If I can execute some sql with these 3 fields to see if there are
> duplicates then maybe I can assume that these are the key fields.
>
> BTW I am a database developer but a C# developer who has been asked to
> solve this problem which has arisen.
>
> Thanks in advance.
SOMEONE must have access to the Informix server directly! On that
server run the Informix schema utility:
dbschema -d <databasename> -t <tablename> -ss
the output will include any UNIQUE indexes and/or UNIQUE or PRIMARY
KEY constraints defined on the
table so you don't have to guess.
Or, you can get the Informix Client Software Development Kit (CSDK)
appropriate for your platform from IBM (free for download if you have
an IBM login, or you can get a slightly older release from the
International Informix Users Group web site (www.iiug.org) on the
members' pages once you register as a free member of that
organization, then download my package, utils2_ak and build my
dbschema replacement utility, myschema, and run it on your client
machine (same options) to get the same output yourself.
Art S. Kagel