Closed cmeeren closed 5 years ago
To understand this better: What happens if you do both joins with (!!)
?
The exact same behavior. And if I only have the other join with (!!)
, it works either way.
By the way, there were some errors in the first query. Fixed now.
One workaround is always creating a view and querying that with SQLProvider, views are visible as tables.
Just saying because multiple left-joins usually leads to large item counts and filtering in in join-conditions, where correct indexing starts to be important. And indexes are more easy to monitor with SQL-tools.
LEFT JOIN (
select ItemId, min(Created) as FirstItem, sum(something) as Sum
from aTable
group by ItemId
) as other on (mything.Id = other.ItemId and other.FirstItem<'2019-01-01')
SQLProvider can go quite far, but it isn't a full fsharp-to-sql compiler.
Yep. Ideally I'd use SqlClient so I can use all the SQL tooling and have full control over the SQL, but our DB is currently still 2005, which SqlClient doesn't support, so... =/ (Update: Seems that's only a design-time limitation; I duplicated the DB on a local SQL Express instance, and can use that for design-time instead with SqlClient.)
Please test, this should be fixed in NuGet package 1.1.63
Great, thanks!
Description
I am encountering a problem with the
(!!)
operator when used on a non-FK join (related: #590).The following code compiles and runs fime:
However, if I switch the
join pLio
andfor pAc
lines, I get a runtime error (compiles fine):I don't know what more information I can provide. Let me know if you need anything. Unfortunately I have no idea how to create a minimal, isolated repro since this is dependent on our DB schema.
Known workarounds
Change the order of the lines (though I can't guarantee this is possible for all cases).
Related information