I have 2 columns in a single table. One column are all date values the other column's data are all integers. How can I get the date from the date column based on the minimum value in the column of integers? Thanks for all and any help.
SELECT IntegerColumn, DateColumn
FROM
(
SELECT [T_RowNumber] = ROW_NUMBER()
OVER
(
-- PARTITION BY OptionalPartitionColumn(s)
ORDER BY IntegerColumn DESC
),
IntegerColumn,
DateColumn
FROM YourTable
) AS T
WHERE T_RowNumber = 1
-- ORDER BY SomeColumn
Thank you very much. Works like a charm and thank your for your fast response.