当前位置:网站首页>sqlite创建表联合主键的sql写法
sqlite创建表联合主键的sql写法
2022-07-27 17:20:00 【荆楚闲人】
像下面那样创建TStudent表,让id,.name为联合主键
create table TStudent(
id INT primary key not null,
name VARCHAR(50) primary key not null
);会报如下错误:
Error:table "TStudent" has more than one primary key
正确的写法为如下:
create table TStudent(
id INT,
name VARCHAR(50),
primary_key(id, name)
);即联合主键,要写在建表语句最后一行,在primary key ()括号里面,且用逗号隔开。
边栏推荐
- mysql学习录(三)多表查询、子查询、分页查询、case语句、单行函数
- Pytorch reports CUDA error: no kernel image is available for execution on the device error
- Application pool has been disabled
- TSMC 5nm is about to mass produce: Apple A14 monopolizes 70% of the production capacity, and Huawei Kirin 1020 takes 30%
- [Huawei cloud stack] [shelf presence] issue 13: have you seen the decoupling architecture of the management area? Help government and enterprise customers solve big problems
- [basic knowledge of deep learning - 46] Bayesian theorem and conditional probability formula
- Session攻击
- Matplotlib (basic usage)
- The go zero singleton service uses generics to simplify the registration of handler routes
- GestureOverlayView(手势识别2)
猜你喜欢
随机推荐
mysql学习录(三)多表查询、子查询、分页查询、case语句、单行函数
VS2017#include 'xxx.h'
VirtualBox: set shared folder
go-zero单体服务使用泛型简化注册Handler路由
被动收入:回归原始且安全的两种赚取方法
MySQL time zone problem
Datepicker and TimePicker
Influxdb series (IV) TSM engine (storage principle)
Hyperledger caliper is built on fabric for performance test
Systemservice (system service)
GestureOverlayView(手势识别2)
BroadcastReceiver(广播)
Cesium常用坐标系详细介绍
Intent(有无返回值得跳转)
[basic knowledge of deep learning - 41] quick start learning materials for deep learning
JVM概述和内存管理(未完待续)
Fabric上搭建Hyperledger caliper进行性能测试
Sharepreference (storage)
顶级“黑客”能厉害到什么地步?无信号也能上网,专家:高端操作!
C#网络应用编程,实验2:IP地址转换和域名解析练习
![[basic knowledge of deep learning - 46] Bayesian theorem and conditional probability formula](/img/9f/b9d7503404e068495fd8613df29366.png)








