OK this is a bit tricky but basically in my SQL statement im comparing prices between fields in each row to get the lowest value returned, now the issue is that each value has a link.
Would there be a way to return the correct link depending on the lowest value in an SQL statement?
below is my SQL statement.
SELECT
title,
my_value,
my_ink,
LEAST(site_a_value, site_b_value, site_c_value) AS lowest_value,
site_a_link,
site_b_link,
site_c_link
FROM STOCK
so for example if site_b had the lowest value I would only want site_b_link to be returned.