Below is the part of my large sql query and I could not find a solution of my problem after spending hours on it. My requirement is only sort the records on RaceNumber ascending and put null records on bottom
SELECT DISTINCT TP.racenumber,
TP.teamid,
TP.teamname
FROM tblteamprofile TP
ORDER BY CASE
WHEN TP.racenumber IS NULL THEN 1
ELSE 0
end,
TP.teamid,
TP.teamname
Can anybody help me it is only my humble request...! please