How do I execute this SQL query I'm trying to execute the following :

db_query('SELECT FROM_UNIXTIME(`created`, "%Y") as year, FROM_UNIXTIME(`created`, "%m") as month, FROM_UNIXTIME(`created`, "%d") as day FROM users ORDER BY `created`');


And because of the % sign the result is :
PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column '%Y' in 'field list'

I tried escaping the % with a double %% resulting in : PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column '%%Y' in 'field list'

Of course this query works in phpmyadmin

Help ?
PDO requires that you use single quotes, e.g.

db_query("SELECT FROM_UNIXTIME(`created`, '%Y') as year, FROM_UNIXTIME(`created`, '%m') as month, FROM_UNIXTIME(`created`, '%d') as day FROM users ORDER BY `created`");