probleme utilisation substr
Bonjour,
Voici ma requete:
Code:
1 2
|
select SUBSTR(date,1,4) from matable GROUP BY SUBSTR(date,1,4) |
Voici la réponse MYSQL:
Citation:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '( date , 1 , 4 ) from orders GROUP BY SUBSTR ( date , 1 , 4 )
date est un champ de ma table, où la date est stockée de la forme suivante:
Donc je cherche a recuperer toutes les années en faisant un substr pour isoler l'année de ma date, mais je ne vois pas pourquoi ca ne marche pas...
Une idée?