SELECT CODE, NAME, (SELECT COUNT(*) FROM [dbo].[LG_001_CRDACREF] WHERE TRCODE = 1 AND CARDREF =dbo.LG_001_ITEMS.LOGICALREF) AS SAY FROM dbo.LG_001_ITEMS WHERE (SELECT COUNT(*) FROM [dbo].[LG_001_CRDACREF] WHERE TRCODE = 1 AND CARDREF =dbo.LG_001_ITEMS.LOGICALREF) <1