> I am trying to establish whether or not it is possible - and how to
> implement the solution - to execute an sql statement and restricting
> the results to a single match even though there may be more than a
> single record which matches the criteria.
>
> e.g. select min(counter) from my_table butonlyone;
SELECT
CASE
WHEN min(my_table.counter) < min(butonlyone.counter) THEN
min(my_table.counter)
ELSE
min(butonlyone.counter)
END AS MinCounter
FROM my_table,butonlyone;
Alternately, you could write a function that takes a number of arguments
(depending on how many you might need... or even an array of values) and
returns the lowest one. That way you could do something like:
SELECT my_min(my_table.counter,butonlyone.counter) AS MinCounter FROM
my_table,butonlyone;
Greg