Ik krijg foutmelding. Hoe los ik dit op?
itgensql056
itgenboe070
itgenboe073
Syntax error between the two '**’ on line 70, column 0:
use all@eol;create…ooporderopmerkingselect division, count()from tst@inm…
Error: extraneous input ‘select’ expecting {, ‘;’}
De query is:
use all@eol
;
create or replace view Voorraadanalyse_r
as
select batchnummer
, artikelcode
, availablequantity
, voorraadwaarde
, vellen
, gemiddelde_kostprijs
, isblocked
, division
, aankooporderopmerking
, listagg(distinct OrderNumber, ', ') ordernumbers
, listagg(distinct leverancier, ', ') leverancier
from ( select bnr.batchnumber batchnummer
, itm.code artikelcode
, bnr.availablequantity
, bnr.availablequantity * itm.averagecost voorraadwaarde
, bnr.Remarks vellen
, itm.averagecost gemiddelde_kostprijs
, bnr.isblocked
, bnr.division
, por.Remarks aankooporderopmerking
, por.OrderNumber ordernumber
, act.name leverancier
from SyncStockBatchNumbers@eol t1
join ExactOnlineREST.Inventory.BatchNumbers@eol bnr
on bnr.division = t1.division
and bnr.id = t1.batchnumberid
join ItemsIncremental@eol itm
on itm.division = bnr.division
and itm.id = bnr.item
and itm.IsStockItem = true
left
outer
join GoodsReceiptLineBatchNumbers glr
on glr.division = t1.division
and glr.bnrbatchnumberid = t1.batchnumberid
left
outer
join PurchaseOrderLinesIncremental@eol pol
on pol.division = glr.division
and pol.Id = glr.PurchaseOrderLineID
and pol.LineNumber != 0
left
outer
join PurchaseOrderLinesIncremental@eol por
on por.division = pol.division
and por.PurchaseOrderID = pol.PurchaseOrderID
and por.LineNumber = 0
left
outer
join AccountsIncremental@eol act
on act.division = por.division
and act.id = por.Supplier
)
group
by batchnummer
, artikelcode
, availablequantity
, voorraadwaarde
, vellen
, gemiddelde_kostprijs
, isblocked
, division
, aankooporderopmerking
select division, count(*)
from tst@inmemorystorage
where availablequantity != 0
group by division
select division, count(*)
from tst@inmemorystorage
where availablequantity not between -1e-5 and +1e-5
group by division