Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First and last based on same SQL
Message
De
10/10/2014 11:39:37
 
 
À
10/10/2014 11:28:40
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01609079
Message ID:
01609143
Vues:
38
>Ok, I think I got it (hopefully). A simple query with no subqueries:
>
>select top 1 i1.ApprovedPersonName as FirstPerson, i2.ApprovedPersonName as LastPerson
>	from Invoice i1 inner join Invoice i2 on i2.NoClient = i1.NoClient
>	where i1.NoClient = 1
>	order by i1.AddDate, i2.AddDate desc
>
>
>will give you back Michel Fournier and King Kong (I remember the days you were an extra in a movie, glad to see you now as a main character!).

Thanks, this is another approach. But, is it really more simple than Message #1609137 and/or more performant?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform