Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MS-SQL Query Help
Message
 
 
À
24/12/2016 03:53:51
Mazahir Naya
Pixel Digital Systems LLC
Émirats Arabes Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008 R2
OS:
Windows 7
Divers
Thread ID:
01646004
Message ID:
01646026
Vues:
45
Minor fix in Martina's query:
SELECT AA."Company Code", AA.Name,
             (SELECT BA.Email + '; '
                 FROM myTable BA
                 WHERE BA.[Company Code] = AA.[Company Code] and BA.[Name] = AA.[Name]
                FOR XML PATH('')
             ) AS Email
  FROM (SELECT DISTINCT "Company Code", NAME 
                FROM myTable
           ) AA
>hello Martina
>
>so far query working fine but duplicate record is still in query output.
>
>Query Out Put:
>Company_Code Name Email
>001 Chung, Kristina abc@xyz.com;asdfg@gmail.com;
>001 Lawrence, Neal abc@xyz.com;asdfg@gmail.com;
>
>002 Gallagher, Marian maza@gmail.com;mazahir.naya@gmail.com;
>002 Steele, Alex maza@gmail.com;mazahir.naya@gmail.com;
>
>003 Hawkins, Stephanie rohit@gmail.com;mprint@pixel.com;
>003 Middleton, Tim rohit@gmail.com;mprint@pixel.com;
>
>004 Frame, Mark shanty@kuwait.com;
>
>Thank You.
>Best Regards,
>Mazahir
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform