include datname and remove WHERE clause