Could anyone help me to achieve this using SQL. I am a very basic user in SQL and tried doing it with GROUP BY in combination with HAVING Clause but it was filtering the records which i dot want to.
All i a want to acieve here is the Relative month column. Wherever there is maximum MonthNUmber the correpsponding column should be designated as "Current Month"
You could use a subquery to do this:
SELECT ID, EmpName, MonthNumber, CASE WHEN MonthNumber = (SELECT MAX(MonthNumber) FROM yourTable) THEN 'Current' ELSE NULL END AS RelativeMonth FROM yourTable