Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very complicated SQL
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01594412
Message ID:
01594424
Vues:
34
>
>SELECT AA.InvoiceDetailNumero, AB.InvoiceDetailNumero
>  FROM (SELECT MAX(InvoiceDetail.Numero) AS InvoiceDetailNumero
>          FROM Invoice INNER JOIN InvoiceDetail ON Invoice.Numero=InvoiceDetail.NoInvoice
>          WHERE Invoice.NoCompany=32 AND InvoiceDetail.NoStatus=7
>       ) AA CROSS APPLY (SELECT MAX(Numero) AS InvoiceDetailNumero
>                           FROM InvoiceDetail
>                           WHERE Numero<AA.InvoiceDetailNumero
>                         ) AB
>            INNER JOIN InvoiceDetail AC ON AC.Numero=AB.InvoiceDetailNumero AND AC.NoStatus=3
>
This SQL does not return any record.
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