3

Here is the code and error message, and any hints are appreciated. Using My SQL Workbench/MySQL,

CREATE SEQUENCE seq_person                                
MINVALUE 1
START WITH 1
INCREMENT BY 1
CACHE 10

Error Code: 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 'SEQUENCE seq_person                                #how to? MINVALUE 1 START WIT' at line 1

thanks in advance, Lin

4
  • 1
    There's no such thing as CREATE SEQUENCE in MySQL. Commented Aug 27, 2015 at 6:44
  • @Barmar, what is the equivalent implementation/statement in MYSQL? Commented Aug 27, 2015 at 6:45
  • MySQL uses the AUTO_INCREMENT option on the primary key column of the table. Commented Aug 27, 2015 at 6:45
  • Got it, thanks. Could you reply as answer so that I can mark as answer to benefit other people (include Google :P)? :) Commented Aug 27, 2015 at 6:45

1 Answer 1

1

Actually MySQL does not have a SEQUENCE. However you can use AUTO_INCREMENT columns just like described here: http://www.tutorialspoint.com/mysql/mysql-using-sequences.htm

Sign up to request clarification or add additional context in comments.

1 Comment

in 6 mins. For sure. Take a Cafe. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.