Inner join for database request