///////////////////////SQL generated////////////////////////
SELECT
"B"."PED_ID" AS "PED_ID",
"B"."PED_DATA" AS "PED_DATA",
"B"."PED_HORA" AS "PED_HORA",
"B"."PED_CLI_CPFCNPJ" AS "PED_CLI_CPFCNPJ",
"B"."PED_CLI_NOME" AS "PED_CLI_NOME",
"F"."PEDPOS_POSICAO" AS "PEDPOS_POSICAO"
FROM "PED" AS "B"
OUTER APPLY (SELECT FIRST (1) "C"."PEDPOS_ID" AS "PEDPOS_ID", "C"."PEDPOS_POSICAO" AS "PEDPOS_POSICAO"
FROM ( SELECT
"E"."PEDPOS_ID" AS "PEDPOS_ID",
"E"."PEDPOS_POSICAO" AS "PEDPOS_POSICAO"
FROM "PEDPOS" AS "E"
WHERE "B"."PED_ID" = "E"."PED_ID"
) AS "C"
ORDER BY "C"."PEDPOS_ID" DESC ) AS "F"

Damasio added a comment - 25/May/12 12:53 PM
I tried several other ways to achieve the same result, but always with an error.
Only if you had not (OrderByDescending (o => o.PEDPOS_ID)), but I need it.
unfortunately I'm in trouble.
You any alternative to a linq command that does not generate the error?

Can you explain why this is marked as "Won't Fix"? The Firebird provider is generating SQL that is not supported by Firebird, surely that is a bug that warrants looking at? Disappointed to see this still unfixed after 4 years.

Nick Coad added a comment - 04/Oct/16 04:16 AM Can you explain why this is marked as "Won't Fix"? The Firebird provider is generating SQL that is not supported by Firebird, surely that is a bug that warrants looking at? Disappointed to see this still unfixed after 4 years.

Jiri, your provider is generating invalid Firebird SQL, that's the real issue. We all understand that OUTER APPLY is not supported by Firebird, and the bug we're reporting is that your provider is generating a query that contains OUTER APPLY, despite this being unsupported on Firebird.

Nick Coad added a comment - 04/Nov/16 02:38 AM Jiri, your provider is generating invalid Firebird SQL, that's the real issue. We all understand that OUTER APPLY is not supported by Firebird, and the bug we're reporting is that your provider is generating a query that contains OUTER APPLY, despite this being unsupported on Firebird.