SELECT CODE, NAME
FROM dbo.LG_077_ITEMS
WHERE (CODE NOT IN
(SELECT LG_077_ITEMS_1.CODE AS URUNKODU
FROM dbo.LG_077_CLCARD INNER JOIN
dbo.LG_077_ITEMS AS LG_077_ITEMS_2 ON dbo.LG_077_CLCARD.LOGICALREF = LG_077_ITEMS_2.LOGICALREF LEFT OUTER JOIN
dbo.LG_077_05_STLINE ON dbo.LG_077_CLCARD.LOGICALREF = dbo.LG_077_05_STLINE.CLIENTREF LEFT OUTER JOIN
dbo.LG_077_ITEMS AS LG_077_ITEMS_1 ON dbo.LG_077_05_STLINE.STOCKREF = LG_077_ITEMS_1.LOGICALREF
WHERE (LG_077_ITEMS_1.CARDTYPE = 1) AND (dbo.LG_077_05_STLINE.TRCODE IN (7,
) AND (dbo.LG_077_CLCARD.CODE = '72128415')
GROUP BY LG_077_ITEMS_1.CODE)) AND (ACTIVE = 0)
Aktif kartlar içerisinde Perakende yada toptan olarak satilmayan ürünleri listeleyen Sql.
en sondaki (dbo.LG_077_CLCARD.CODE = '72128415') kodu değiştirerek başka müşteriler için oluşturmak mümkün.
inşallah işine yarar..
İşine yararsa Allah razı olsun de yeter