I have a query that I use to indicate locations in a map where there are overlapping points:
select min(objectid) as min_objectid, longitudex, latitudey, count(1) as count, min(shape) as min_shape from workorders group by longitudex, latitudey having count(1) > 1
In the mapping software that I use, I need to include columns like
shape. For those columns, it doesn’t matter which of the grouped-by rows the values come from, just as long as there is a value.
Presently, I’m using
min() to get an arbitrary value for those columns. However, I don’t know if that’s the fastest option since finding the minimum value would require calculation — and I wonder if that time spent is unnecessary.
What is the fastest option for getting an arbitrary/single value for GROUP BY in an Oracle query?