itgensql035
Unknown identifier ‘t.glaccount’.
Consider one of the following: PrivateGLAccount, VATNonDeductibleGLAccount, YearEndCost…
Query:
SELECT t.glaccount, t.glaccountcode,
(SELECT CODE
FROM exactonlineRest#financial.Glaccountsubulk g
WHERE g.id = t.glaccount)
FROM exactonlineRest#financialtransaction.transactionlinesbulk t
Er wordt een scalar subquery gebruikt (ook bekend als correlated subquery). Deze subquery legt een relatie naar buiten de subquery.
Uit performance en query onderhoudsoverwegingen ondersteunt Invantive UniversalSQL deze vorm bewust niet.
Advies is om de query om te schrijven naar een expliciete join zoals:
select t.GLAccount
, t.GLAccountCode
, g.Code
from exactonlineRest#financialtransaction.transactionlinesbulk t
join exactonlineRest#financial.GLAccountsBulk g
on g.ID = t.GLAccount
and. g.Division = t.Division
Dit is de query die Microsoft SQL Server er ook van hoort te maken.
Deze vraag is automatisch gesloten na 1 week inactiviteit. Het laatste gegeven antwoord is gemarkeerd als oplossing.
Gelieve een nieuwe vraag te stellen via een apart topic als het probleem opnieuw optreedt. Gelieve in de nieuwe vraag een link naar dit topic op te nemen door de URL er van in de tekst te plakken.