finding duplicate fields

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This may be a particularly dumb question, but I'm wrestling with it anyways.
Is there a way, to discern a duplicate field among records in a table. For
example, suppose I have a table such that:

CREATE TABLE `sometable` (
  `id` int(11) NOT NULL auto_increment,
  `sometext` varchar(80) NOT NULL default '',
  PRIMARY KEY  (`id`)

I want to find all records where  `sometext` =  `sometext` in another
record. That is, I want to find those records where there is more than one
instance of  `sometext` without regard to what  `sometext` is. I may have a
row where   `sometext` = "abc" and another where it is `zyx` and I do not
want to put a value for   `sometext` into the WHERE portion of my sql select
statement. How can I find duplicated fields where I dont know what the value
of the field being duplicated is a priori? Thanks, Ike

Re: finding duplicate fields

Try this:
SELECT f.*, s.* FROM firsttable f, secondtable s WHERE f.somecolumn =

Quoted text here. Click to load it

Site Timeline