Discuss / SQL / 无法运行教程内的命令

无法运行教程内的命令

Topic source

荒风森林

#1 Created at ... [Delete] [Delete and Lock User]

输入 ALTER TABLE students ADD INDEX idx_name_score (name, score);

显示 ERROR when execute SQL: ALTER TABLE students ADD INDEX idx_name_score (name, score) SyntaxError: Parse error on line 2: ... TABLE studentsADD INDEX idx_name_score ----------------------^ Expecting 'COLUMN', got 'INDEX'

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

这个在线的SQL是JS写的,只能执行SELECT/UPDATE/DELETE/INSERT这些常用SQL,ALTER TABLE当然执行不了了,ADD INDEX对JS对象有啥意义?

荒风森林

#3 Created at ... [Delete] [Delete and Lock User]

谢谢廖大大回复,新手来着,现在明白了。


  • 1

Reply