Received: from druid.net (root@druid.net [198.96.119.226]) by hub.org (8.9.2/8.9.1) with ESMTP id RAA85604 for ; Mon, 8 Feb 1999 17:49:49 -0500 (EST) (envelope-from darcy@druid.net) Received: from localhost (1551 bytes) by druid.net via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) (ident using unix) id for ; Mon, 8 Feb 1999 17:49:36 -0500 (EST) (Smail-3.2.0.104 1998-Nov-20 #1 built 1998-Nov-24) Message-Id: Subject: Re: [SQL] Quickie In-Reply-To: <19990208215723.11594.qmail@desertmoon.com> from "pierre@desertmoon.com" at "Feb 8, 1999 02:57:22 pm" To: pierre@desertmoon.com Date: Mon, 8 Feb 1999 17:49:35 -0500 (EST) From: "D'Arcy" "J.M." Cain Cc: pgsql-sql@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL50 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Thus spake pierre@desertmoon.com > Given: > User_Email|User_ID > ------------------- > fubar | 1 > barfu | 2 > snafu | 3 > Fubar | 4 > > What query could I use to return ONLY 'fubar' and 'Fubar'? Would I do a self Well, the obvious is; SELECT * FROM x WHERE User_Email = 'fubar' OR User_Email = 'Fubar'; But I assume you are looking for something more useful. Are you trying to catch all entries not in all lower case? Try this: SELECT * FROM x WHERE User_Email != lower(User_Email); Or you can convert to lower with this: UPDATE x SET User_Email = LOWER(User_Email); If you have a unique index on User_Email then the ones that already exist will fail and then you can use the first one to find the ones that didn't get converted. Those will be the dups. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.