Randy, For "general" SQL questions, you might find something in a newsgroup, such as comp.databases.*, but there are so many peculiarities, even among the most compliant datbases, that it's hard to really ask a "general" question.
As for your unique values... > -----Original Message----- > From: Randy Chrismon [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 21, 2003 10:15 AM > > I have a table wherein one column is SUPPOSED to be unique > but I strongly suspect isn't. Because I had this suspicion, I > did not apply a unique index to the column. Assuming there > are no null values in that column how would I find the > instances of non-unique values? You can use a query such as : SELECT SupposedlyUniqueColumn, count(*) FROM myTable GROUP BY SupposedlyUniqueColumn HAVING COUNT(*) > 1; This will return all the values which occur more than once, and, for free, also tells you how many times it occurs. Further queries using that value can show you the particular rows. > If I try to alter table add > unique... will it abort if the values are non-unique, or will > it drop the non-unique rows? Yes. You'll get a fairly useful error message, as in the following: create table bob ( i int ); insert into bob values ( 1 ); insert into bob values ( 2 ); insert into bob values ( 2 ); create unique index bob_ux01 on bob ( i ); ERROR 1062: Duplicate entry '2' for key 1 So you can actually make progress this way, since you've got at least one duplicated key to go tackle. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]