Description
From what I can see in the code, the column "Latest Visit Status" on the candidate_list contains the result of max(s.Current_stage) AS LatestVisitStatus
(grouped by CandID). This means that the column contains the highest (alphabetically) of the set 'Not Started', 'Screening', 'Visit', 'Approval', 'Subject', 'Recycling Bin'
(the valid options of Current_stage in the session table) that the candidate has for any session. ie. if a candidate has sessions with values of "Not Started", then "Visit", then a last visit of "Approval" the value of "Latest Visit Status" will be "Visit".
It's not clear how that is supposed to be meaningful or what relation it has to the "Latest Visit Status". It seems to be the result of someone not understanding how "max" works on enums when writing the query.
Given that it doesn't work and no one has noticed, it seems like the column isn't really used and should be removed to free up space in an already excessively large table.