You must fully qualify the columns to tell parser from where it should take values. so change like this:-SELECT book_month, region_book, {a/b}.product_group as base_prod_group, {a/b}.cnt as base_cnt FROM collections.v_nonpay_trend_base ajoin collections.v_nonpay_trend_npdata bon (a.book_month=b.disc_check_in_month and a.region_book=b.region and a.base_prod_group=b.product_group)use either a or b as alias in code in blue.