let iq s t = query {
for image in ctx.Dbo.TImage do
sortBy (image.FImageid)
skip s
take t
select image.FName
}
iq 10 10 |> Seq.iter(fun (f) -> printfn "%A" f)
WITH CTE AS (
SELECT
[TImage].[F_NAME] as 'F_NAME',
ROW_NUMBER() OVER(
ORDER BY
[F_IMAGEID]
) AS RN
FROM
[dbo].[TImage] as [TImage]
)
SELECT
[TImage].[F_NAME] as 'F_NAME'
FROM
CTE []
WHERE
RN BETWEEN 11
AND 20
CTE [] should be CTE [TImage]
This work fine
let iq s t = query {
for image in ctx.Dbo.TImage do
sortBy (image.FImageid)
skip s
take t
select image
}
iq 10 10 |> Seq.iter(fun (f) -> printfn "%A" f)
Description
Incorrectly generated SQL request when used skip.
This code generates the following SQL query.
CTE [] should be CTE [TImage]
This work fine
difference in select image.FName or select image
Related information