Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a table with multiple field PK
Message
De
26/08/2002 10:59:07
 
 
À
25/08/2002 18:17:27
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00693482
Message ID:
00693662
Vues:
21
>Will this accomplish my goal?

Don't know. What is your goal?

>DELETE FROM conphone WHERE conuniq in (SELECT conuniq FROM cisconphone) and phnnumber in (SELECT phnnumber FROM cisconphone).

WATCH THIS!!!! This will delete all the rows in conphone where conuniq is stored in any row in cisconphone AND phnnumber is stored in any row in cisconphone AND THERE IS NO REQUIRED THAT IT IS THE SAME ROW.

Is this what you want?

-Mike


>
>Will this accomplish my goal?
>
>INSERT INTO conphone
>SELECT * FROM cisconphone
>WHERE conuniq not in (
> SELECT conuniq
> FROM cisconphone
> GROUP BY conuniq
> HAVING (COUNT(conuniq) > 1)
> )
>AND
>
>phnnumber not in
> (
> SELECT phnnumber
> FROM cisconphone
> GROUP BY phnnumber
> HAVING (COUNT(phnnumber) > 1)
> )
>
>
>Thanks
>Jim
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform