开发者

mysql create table help with unique

开发者 https://www.devze.com 2023-01-01 00:15 出处:网络
I\'m trying to create a table, and can\'t figure out how to assign two columns to be unique.. I know how to alter a table thats already created, but how do you do it in the create..

I'm trying to create a table, and can't figure out how to assign two columns to be unique.. I know how to alter a table thats already created, but how do you do it in the create..

im after a create if not exist col1 TEXT, col2 TEXT, col3 TEXT unique(col1, col2)

^very rough bas开发者_StackOverflow社区ic but you get the idea


Put that the end of your table, put a comma after your last TEXT

UNIQUE (
`temp`
)
0

精彩评论

暂无评论...
验证码 换一张
取 消