Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql Syntax to make this group by ?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00755254
Message ID:
00755448
Vues:
16
sorry i would say only one per Client in My Result.

>Hi Leo thank's a lot for you answer but if i have 2 note with the same date
>i would like to get only on in my result
>
>Do you have a idea ?
>
>Thank's in advance
>Rock
>
>
>
>>Hi Rock,
>>
>>I', not realy sure, because I don't have the equipment right know.
>>you can try this:
>>
>>Select N1.*
>>	From Note N1
>>	Join (Select ClientId, Max(Date) As Date From Note Group By ClientId) N2
>>		On N2.ClientId = N1.ClientId And N2.Date = N1.Date
>>
>>hth,
>>Leo
>>>Hi everybody,
>>>
>>>I Have a Note table look like that
>>>
>>>UniqueId ClientId Note Date
>>>1 1 Comments Bla Bla 2003-01-15
>>>2 1 xxx yyyy sfdfd 2003-02-01
>>>3 1 yyrtr bghggggg 2003-01-19
>>>4 2 zzzz zzzz kdfjd 2001-01-15
>>>5 2 zzrrrrrr rrrrr 2003-01-01
>>>
>>>I would like to have only one note per Client but the one who have the greatiest Date.
>>>
>>>Exemple of the result i want.
>>>
>>>UniqueId ClientId Note Date
>>>2 1 xxx yyyy sfdfd 2003-02-01
>>>5 2 zzrrrrrr rrrrr 2003-01-01
>>>
>>>I try a lot of thing but noting work fine
>>>Do you have an idea of the Syntaxe i need to do the jod...
>>>Thank's in Advance
>>>Rock
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform