Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very complicated SQL
Message
 
To
15/02/2014 14:24:20
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01594412
Message ID:
01594425
Views:
40
>>
>>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.

I'm sorry, I have not your data.

MartinaJ
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform