I have a table named "students". It contains data like this:code | name -----+------AF1 | AliceAM2 | BobAF3 | CindyAM4 | DaveAF5 | Erica
I want to access that table using PHP. The syntax select is like this:select * from view_studentsThe output must be like this:code | name | Sex-----+-------+-------AF1 | Alice | FemaleAM2 | Bob | MaleAF3 | Cindy | FemaleAM4 | Dave | MaleAF5 | Erica | Female
Sex is taken from 2nd character of code. If F, it means Female. If M, it means Male. How to create View for this?I have try to using this, but not work.select *, (iif(substring(code, 2, 1)) = 'F', 'Female', 'Male') as sex from students