Gunakan fungsi agregat MIN
:
SELECT MIN(date_added) AS OldestDate
FROM products_to_categories
WHERE products_id = 2085;
Jika Anda mencari tanggal terlama untuk setiap produk, tambahkan GROUP BY
:
SELECT products_id, MIN(date_added) AS OldestDate
FROM products_to_categories
GROUP BY products_id;