SQL statement more coherent