Skip to content

Instantly share code, notes, and snippets.

@serefyarar
Last active August 29, 2015 14:00
Show Gist options
  • Save serefyarar/11352654 to your computer and use it in GitHub Desktop.
Save serefyarar/11352654 to your computer and use it in GitHub Desktop.
Nebim Stok View
SELECT
s.nStokID as StokID,
sb.sBarkod as Barkod,
s.sModel as Model,
s.sKodu as StokKodu,
s.sAciklama as ModelAdi,
r.sRenkAdi as Renk,
s.sBeden as Beden,
r.sRenk as RenkID,
s.sBedenTipi as BedenTipi,
sf.lFiyat as Fiyat,
CONVERT(INT,( SELECT ISNULL(SUM(tbStokFisiDetayi.lGirisMiktar1),0) FROM tbStokFisiDetayi WHERE s.nStokID = tbStokFisiDetayi.nStokID )) AS Giren ,
CONVERT(INT,( SELECT ISNULL(SUM(tbStokFisiDetayi.lGirisMiktar1),0) FROM tbStokFisiDetayi WHERE s.nStokID = tbStokFisiDetayi.nStokID )-( SELECT ISNULL(SUM(tbStokFisiDetayi.lCikisMiktar1),0) FROM tbStokFisiDetayi WHERE s.nStokID = tbStokFisiDetayi.nStokID )) AS Kalan
FROM tbStok s
LEFT JOIN tbRenk r ON r.sRenk = s.sRenk
LEFT JOIN tbStokBarkodu sb ON sb.nStokID = s.nStokID
LEFT JOIN tbStokFiyati sf ON sf.nStokID = s.nStokID AND sf.sFiyatTipi='TS9'
WHERE sb.sBarkod IS NOT NULL
@volkanmetin
Copy link

tamamdır tşk 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment