query and reference can have different datatype