J'utilise ceci:Mysql - année la sélection d'un timestamp unix
SELECT FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year FROM table_name WHERE year = 2009;
mais il me donne une erreur:
Unknown column 'year' in 'where clause'SELECT FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year FROM table_name WHERE year = 2009
deux "my_unix_timestamp_column" et "nom_table" sont corrects, je ne sais pourquoi ça me donne ça !!!
J'utilise PHP 5.3.0
La partie concernant la section 'SELECT' est fausse. Je ne vais pas vous downvote, mais essayez d'exécuter la requête suivante: 'SET @r: = 1; SELECT @r: = id + 1 FROM mytable WHERE @r = id' sur n'importe quelle table avec des identifiants consécutifs commençant par '1'. – Quassnoi