如何在MySQL中創建自定義主鍵?例如我有表和表名是X,我有一個表字段爲ID,Code,Name。 恐怕如果我有1000個用戶,當他們一起輸入將 結果破壞 ,我想: INSERT INTO `X` (`ID`,`Code`,`Name`) VALUES
('P3K','Alex'), // this primary key is "P3K-1"
('SOS','Force'), // this
我使用Room持久庫。我有要求在一個表中添加兩個主鍵,其中一個主鍵應該是自動增量。我不知道確切的語法來實現這一點。以下是我的模特類: @Entity(tableName = "newsPapers", primaryKeys =
{"news_paper_id","news_paper_name"})
public class SelectNewsModel {
private int n
我有一個自動遞增的id表。該ID也是另一個表中的外鍵。當我嘗試將值添加到這些表我得到一個異常 - 列數並不在行1 匹配值計數這些都是我的表: CREATE TABLE Hotspot(
num int auto_increment not null,
id varchar(255),
x int,
y int,
width int,
height int,
UNIQUE(id),