CREATE OR REPLACE FUNCTION core.get_office_id_by_sales_tax_id(_sales_tax_id integer) RETURNS integer LANGUAGE plpgsql AS $function$ BEGIN RETURN office_id FROM core.sales_taxes WHERE core.sales_taxes.sales_tax_id=$1; END $function$