Added query with inner join