PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.database.mysql > finding duplicate fields
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
finding duplicate fields

Réponse
 
LinkBack Outils de la discussion
Vieux 09/06/2006, 15h39   #1
Ike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut finding duplicate fields

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


  Réponse avec citation
Vieux 19/05/2007, 18h08   #2
VeloMaster
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: finding duplicate fields

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
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h04.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08036 seconds with 10 queries