I am using this:
SELECT FROM_UNIXTIME(my_unix_timestamp_column, \'%Y\') AS year FROM table_name WHERE year = 2009;
but it gives me an error
You can't use a column created the SELECT section in your WHERE clause
replace the year variable in your where clause with the actual function to create that column (aka FROM_UNIXTIME(my_unix_timestamp_column, '%Y') ) and you should be fine.
This is because the SELECT section of your query isn't executed until the WHERE section has finished matching rows to return.