SQL SORGUSU BU UMARIM İŞİNE YARAR
SELECT dbo.LG_008_CLCARD.CODE , dbo.LG_008_CLCARD.DEFINITION_ , dbo.LG_008_CLCARD.CITY , dbo.LG_008_CLCARD.SPECODE , dbo.LG_008_ITEMS.NAME , dbo.LG_008_ITEMS.STGRPCODE , dbo.LG_008_04_STFICHE.INVNO , dbo.LG_008_04_STFICHE.DATE_ , dbo.LG_008_04_STFICHE.SOURCEINDEX , dbo.LG_008_04_STLINE.AMOUNT , dbo.LG_008_04_STLINE.PRICE , dbo.LG_008_04_STLINE.TOTAL , dbo.LG_008_04_STLINE.VATMATRAH , dbo.LG_SLSMAN.DEFINITION_ , dbo.LG_008_04_STFICHE.TRCODE FROM LG_008_04_STFICHE INNER JOIN LG_008_04_STLINE ON LG_008_04_STLINE.STFICHEREF = LG_008_04_STFICHE.LOGICALREF INNER JOIN LG_008_CLCARD ON LG_008_CLCARD.LOGICALREF=LG_008_04_STLINE.CLIENTREF INNER JOIN LG_008_ITEMS ON LG_008_ITEMS.LOGICALREF=LG_008_04_STLINE.STOCKREF LEFT OUTER JOIN LG_SLSMAN ON LG_SLSMAN.LOGICALREF=LG_008_04_STLINE.SALESMANREF WHERE dbo.LG_008_04_STLINE.LINETYPE=0 AND LG_008_04_STFICHE.CANCELLED=0 AND LG_008_04_STFICHE.TRCODE IN (1) ORDER BY dbo.LG_008_ITEMS.STGRPCODE