SELECT * from Gs1.dbo.organizacia OUTER APPLY (SELECT TOP 1 *FROM Gs1.dbo.SAKONTAQTO WHERE prefix= org_pref and tanamdeboba='GEPI¦') AS A