to all mysql guru
what is wrong with this
SELECT Sum( member_area_of_law.years ) AS total_year FROM member_area_of_law WHERE total_year =460
i got an error Unknown column 'total_year' in 'where clause'
but I already make/Assigned using AS
Sounds like you're experiencing a problem with column aliases.
make sure that you have a column named 'total_year' in your table.
it doesnt need to have a column for total_year since it use Aliases , anyhow i solved this one
SELECT Sum( member_area_of_law.years ) AS total_year FROM member_area_of_law having total_year =460
instead of using Where it will use Having