INSERT INTO PlaceCodeTemp ( PlaceArm, Id, CountryPlace )
SELECT IIf(PlaceCode.PlaceArm='',"Չորոշված",PlaceCode.PlaceArm) AS Выражение1, Min(PlaceCode.Id) AS Id, IIf(PlaceCode.ErkCode=0,IIf(PlaceCode.id In (0.1),"Հայաստան",IIf(PlaceCode.id=2,"Արտասահման","Չորոշված")),IIf(PlaceCode.ErkCode=374,"Հայաստան",IIf(IsNull(PlaceCode.ErkCode),"Չորոշված","Արտասահման"))) AS CountryPlace
FROM PlaceCode
GROUP BY PlaceCode.PlaceArm, PlaceCode.ErkCode;
|