first query with output