For forums, blogs and more please visit our
Developer Tools Community.
By: Borland Staff
Abstract: You can run a query to see if there duplicates
How to determine if a set of columns have unique values for rows in a table
This may be necessary when trying to create a unique index and it fails
claiming that there are duplicate values.
The information in this article applies to:
* InterBase v4.x
* InterBase v5.x
Use the following query to return a count for the specified columns
having duplicate values:
select col1, col2, ..., colx, count(*) from tablename group by col1, col2, ..., colx having count(*) > 1;
This query will return the rows that have duplicate values. These rows can then be updated so
that the unique index can be created.
Using the example employee.gdb database shipped with InterBase, this query
can be used to determine which customers have more than 1 purchase order
select cust_no, count(*) from sales group by cust_no having count(*) > 1;
Could not retrieve comments. Please try again later.
Free Developer Edition!
Click here to download a free non-expiring Developer Edition or 30-day trial >
More InterBase Info
InterBase XE7 Product Info
Free Developer Edition download
InterBase on Google+
Follow @InterBase on Twitter
Server Response from: ETNASC04