Last active
August 29, 2015 14:00
-
-
Save serefyarar/11352654 to your computer and use it in GitHub Desktop.
Nebim Stok View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tamamdır tşk 😄