Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get Only Records With Sequence = 1
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01397692
Message ID:
01397700
Vues:
45
>
>PartId     PartNo  SerialNo     Sequence
>1          AS345   ANB-121             1
>2          AS345   ANB-122             2
>3          AS345   ANB-123             3
>4          AS345   ANB-124             4
>5          A34SF   1212544             1
>6          B21AC   ANB-A1              1
>7          B21AC   ANB-A2              2
>8          ANG34   ANG34               1
>
>
>From the above set the query should return rows 5 and 8 because those partnumber/serialno combinations only appear once.
>

All rows of your example data have unique partno+serialno... but I think you're looking for something like:

select partno,count(partno) as pcount from mytable having pcount=1
Brandon Harker
Sebae Data Solutions
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform