The syntax of what you have posted does not seem to be correct. Is "a(h.test_id)" invoking a UDF named "a"? If so it needs to be prefixed with the schema name. In any case, is something like this what you are looking for?select h.test_id as Cat,
i.Id as dogid,
i.Capacity as total,
i.office as Company,
300 as Capacity,
400 as Company