Bonjour,
Je débute en curseurs SQL et j'ai écrit le code suivant pour mySQL qui ne fonctionne pas:
et je reçois cette erreur:Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 // selection par heure sur la journée courante; DECLARE DateCursor CURSOR FOR SELECT lastmodificationdate FROM result OPEN DateCursor FETCH NEXT FROM DateCursor WHILE @@FETCH_STATUS = 0 BEGIN select hour(lastmodificationtime), count(*) from result group by hour(lastmodificationtime) END CLOSE DateCursor DEALLOCATE DateCursor
Citation:
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 'DECLARE DateCursor CURSOR FOR
SELECT lastmodificationdate FROM result
OPEN D' at line 1
Quelqu'un pourrait-il m'aider ?
Aussi, je ne sais pas trop ou mettre des délimiteurs (caractère ; dans mon cas)