Skip to content

Instantly share code, notes, and snippets.

@Konctantin
Last active May 1, 2020 14:52
Show Gist options
  • Save Konctantin/d071a0504c1d5af7a0bc99231d152867 to your computer and use it in GitHub Desktop.
Save Konctantin/d071a0504c1d5af7a0bc99231d152867 to your computer and use it in GitHub Desktop.
use kcmod
go
select ISTK.Nom_Vag,
case
when ISTK.PoluchOKPO>0
then coalesce(
(select top 1 '' from dbo.nsDoroga)
, 'ОКПО грузополучателя - '+cast(ISTK.PoluchOKPO as varchar(123))
, ''
)
end as GruzPol
from dbo.nvVagPrivatAT
join dbo.VagonISTK ISTK on ISTK.Nom_Vag = nvVagPrivatAT.Nom_Vag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment