print out selected query result