Alex Rivera | Logout

SQLite primary key on multiple columns

Asked 2009-04-09T15:17:31.807
776

What is the syntax for specifying a primary key on more than 1 column in SQLite ?

Edit
Report

1 Answer

1030

According to the documentation on CREATE TABLE, specifically table-constraint, it's:

CREATE TABLE something (
  column1, 
  column2, 
  column3, 
  PRIMARY KEY (column1, column2)
);
answered 2009-04-09T15:21:34.683

Your Answer