You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTvmpp.idAS vmpp_id,
ampp.idAS ampp_id,
ampp.bnf_codeAS ampp_bnf_code,
vmpp.bnf_codeAS vmpp_bnf_code,
ampp.nmAS ampp_name,
vmpp.nmAS vmpp_name,
dtinfo.priceAS dt_price,
priceinfo.priceAS price,
priceinfo.pricedtAS price_valid_on,
priceinfo.price_prevAS price_prev,
pricebasis.descrAS price_basis,
route.descrAS licensed_route,
supplier.descrAS supplier,
route.descr IS NULLAS possible_wholesaler,
dtpaymentcategory.descrAS category,
CASE
WHEN supplier.descr="A A H Pharmaceuticals Ltd" THEN 2
WHEN supplier.descr="Alliance Healthcare (Distribution) Ltd" THEN 2
WHEN supplier.descr="Actavis UK Ltd" THEN 1
WHEN supplier.descr="Teva UK Ltd" THEN 1
WHEN supplier.descr="Accord Healthcare Ltd" THEN 1
ELSE
NULL
END
AS cat_a_weighting
FROM`ebmdatalab.dmd2.vmpp` vmpp
INNER JOIN`ebmdatalab.dmd2.ampp` ampp
ONampp.vmpp=vmpp.idLEFT JOINebmdatalab.dmd2.discontinuedind
ONdiscontinuedind.cd= disc
LEFT JOINebmdatalab.dmd2.legalcategory
ONlegalcategory.cd= legal_cat
LEFT JOINebmdatalab.dmd2.dtinfo
ONdtinfo.vmpp=vmpp.idINNER JOIN`ebmdatalab.dmd2.dtpaymentcategory` dtpaymentcategory
ONdtpaymentcategory.cd=dtinfo.pay_catLEFT JOINebmdatalab.dmd2.priceinfo
ONpriceinfo.ampp=ampp.idINNER JOINebmdatalab.dmd2.pricebasis
ONpriceinfo.price_basis=pricebasis.cdLEFT JOINebmdatalab.dmd2.licroute
ONampp.amp=licroute.ampLEFT JOINebmdatalab.dmd2.route
ONroute.cd=licroute.routeINNER JOIN`ebmdatalab.dmd2.amp` amp
ONamp.id=ampp.ampLEFT JOIN`ebmdatalab.dmd2.supplier` supplier
ONsupplier.cd=amp.suppWHERE
(disc IS NULLOR disc !=1)
ANDampp.invalid= FALSE
AND NOT (ampp.bnf_code IS NULLANDvmpp.bnf_code IS NULL)
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: