ALTER TABLE tetel ADD COLUMN forditottado_kulcs integer default 0;
UPDATE tetel SET forditottado_kulcs = 0;
UPDATE tetel SET forditottado_kulcs = (SELECT kod from afa_kulcs where afakulcs = 0 and mentes = 0 and eus_tagorszagbeli_ertekesiteshez = 0 and harmadik_orszagbeli_ertekesiteshez_am = 0 and forditott_adozas = 1 and targyi_adomentes = 0 LIMIT 1) WHERE forditottan_adozhat = 1;
