|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Fri, 09 Jun 2006 13:39:10 GMT, "Ike" <rxv@hotmail.com> wrote:
Try this: SELECT f.*, s.* FROM firsttable f, secondtable s WHERE f.somecolumn = s.somecolumn >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 > |
|
![]() |
| Outils de la discussion | |
|
|