Consider sql select table_B_alias.b from table_B_alias where table_B_alias.b in ( select a from table_A_alias ); if table_B_alias.b is int and table_A_alias.a is bigint, we should cast(b as bigint) to make the data type the same as the InSubquery.