add sample code for many to one query