SQLite Forum

Can this simple query be optimized?
Login
I just realized my suggestion may or may not be sufficient for the original poster. Their original union query and the union query above always produce two rows for each group. My version only produces one row when y min and y max are the same.