Hi, Reading the online manual it doesn't get clear to me: can I or can't I define a primary key containing 2 columns, e.g. like: create table <name> (column1 char(10) not null, column2 char(20) not null, primary key (column1, column2)) Thanks Huub
On Thursday 07 Nov 2002 6:57 am, Huub wrote: > Hi, > > Reading the online manual it doesn't get clear to me: can I or can't I > define a primary key containing 2 columns, e.g. like: > > create table <name> (column1 char(10) not null, column2 char(20) not > null, primary key (column1, column2)) Yes you can. The place to check this sort of information is in the SQL Commands reference section of the manuals. From CREATE TABLE: "The primary key constraint specifies that a column or columns of a table may contain only unique (non-duplicate), non-NULL values. " You might also find the functional and partial indexing features of interest. -- Richard Huxton
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера