CREATE PROCEDURE sp_DepoKontrolEkleme
AS
Select * 
  from 
		(
			select DISTINCT Depo from STOKHAR
			UNION
			select DISTINCT Depo from SIPARISHAR
			UNION
			select DISTINCT Depo from TEKLIFHAR
		) x
WHERE NOT EXISTS (select 1 
					from GRUP g 
				   where Turu = 'D' 
				     and g.GrupAdi = x.Depo)
