Adapted query to modification of the table content due to Paolo #505