昨天,我问了question on StackOverflow关于如何将文件导入MySQL表的问题。今天,有人告诉我,由于某些安全问题,IT已“禁用” LOAD DATA INFILE
。因此,现在我必须弄清楚如何创建表,加载我可以加载的任何数据,并针对有问题的列,使用python中的INSERT
或mysqlconnector
分别添加值。我选择了前者,但我来不及尝试找出解决方法。
以下是相关列:
+-----------+
| gene_name |
+-----------+
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
+-----------+
以下是我要为NULL
值切换出的值:
CCR4-NOT transcription complex subunit 2
2'-5'-oligoadenylate synthetase 1
CCR4-NOT transcription complex subunit 2
methenyltetrahydrofolate synthetase domain containing
CUB and Sushi multiple domains 2
CSMD2 antisense RNA 1
neuromedin B
transcription factor Dp-2
neuromedin B
cytokine induced apoptosis inhibitor 1
histone deacetylase 7
UBE2F-SCLY readthrough (NMD candidate)
selenocysteine lyase
UBE2F-SCLY readthrough (NMD candidate)
selenocysteine lyase
microRNA 548h-2
arylacetamide deacetylase
arylacetamide deacetylase pseudogene 1
succinate receptor 1
serpin family B member 6
G protein-coupled receptor 35
methenyltetrahydrofolate synthetase domain containing
coiled-coil domain containing 146
dispatched RND transporter family member 1
family with sequence similarity 186 member B
dynein axonemal light intermediate chain 1
ADAMTS like 3
solute carrier family 15 member 4
methenyltetrahydrofolate synthetase domain containing
two pore segment channel 1
这听起来很疯狂,但是在this post的指导下,我得以提出以下建议:
INSERT INTO testis_sQTL (gene_name) VALUES (
('CCR4-NOT transcription complex subunit 2'),
('2-5-oligoadenylate synthetase 1'),
('CCR4-NOT transcription complex subunit 2'),
('methenyltetrahydrofolate synthetase domain containing'),
('CUB and Sushi multiple domains 2'),
('CSMD2 antisense RNA 1'),
('neuromedin B'),
('transcription factor Dp-2'),
('neuromedin B'),
('cytokine induced apoptosis inhibitor 1'),
('histone deacetylase 7'),
('UBE2F-SCLY readthrough (NMD candidate)'),
('selenocysteine lyase'),
('UBE2F-SCLY readthrough (NMD candidate)'),
('selenocysteine lyase'),
('microRNA 548h-2'),
('arylacetamide deacetylase'),
('arylacetamide deacetylase pseudogene 1'),
('succinate receptor 1'),
('serpin family B member 6'),
('G protein-coupled receptor 35'),
('methenyltetrahydrofolate synthetase domain containing'),
('coiled-coil domain containing 146'),
('dispatched RND transporter family member 1'),
('family with sequence similarity 186 member B'),
('dynein axonemal light intermediate chain 1'),
('ADAMTS like 3'),
('solute carrier family 15 member 4'),
('methenyltetrahydrofolate synthetase domain containing'),
('two pore segment channel 1'));
但是,结果是出现了这个错误:
ERROR 1136 (21S01): Column count doesn't match value count at row 1
我很困惑,因为数据表中的行数与我要插入的条目数相同,但是后来我意识到MySQL试图将这些值追加到列的底部。我不想这样。我希望将要插入的每个值插入其对应的行中。请帮忙。
编辑:如果像您中的某些人建议的那样删除了多余的括号,结果将是附加列:
+-------------------------------------------------------+
| gene_name |
+-------------------------------------------------------+
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL |
| CCR4-NOT transcription complex subunit 2 |
| 2-5-oligoadenylate synthetase 1 |
| CCR4-NOT transcription complex subunit 2 |
| methenyltetrahydrofolate synthetase domain containing |
| CUB and Sushi multiple domains 2 |
| CSMD2 antisense RNA 1 |
| neuromedin B |
| transcription factor Dp-2 |
| neuromedin B |
| cytokine induced apoptosis inhibitor 1 |
| histone deacetylase 7 |
| UBE2F-SCLY readthrough (NMD candidate) |
| selenocysteine lyase |
| UBE2F-SCLY readthrough (NMD candidate) |
| selenocysteine lyase |
| microRNA 548h-2 |
| arylacetamide deacetylase |
| arylacetamide deacetylase pseudogene 1 |
| succinate receptor 1 |
| serpin family B member 6 |
| G protein-coupled receptor 35 |
| methenyltetrahydrofolate synthetase domain containing |
| coiled-coil domain containing 146 |
| dispatched RND transporter family member 1 |
| family with sequence similarity 186 member B |
| dynein axonemal light intermediate chain 1 |
| ADAMTS like 3 |
| solute carrier family 15 member 4 |
| methenyltetrahydrofolate synthetase domain containing |
| two pore segment channel 1 |
+-------------------------------------------------------+
此外,出于可读性原因,表中还有其他几列未选择显示。
编辑:由于这似乎很重要,因此我表的其余部分如下所示:
+-------------------------------------+-------+-------------+-----------+--------+----------------------+---------------+-----------+-----------+-------------+-----------+-------------+-------------+-------------+--------+---------+-----------+------------+-------------------------------------------------------+
| intron_cluster | chrom | pheno_start | pheno_end | strand | variant_id | variant_chrom | var_start | var_end | p | beta | emp_p | adj_p | qval | width | istrand | gene_id | symbol | gene_name |
+-------------------------------------+-------+-------------+-----------+--------+----------------------+---------------+-----------+-----------+-------------+-----------+-------------+-------------+-------------+--------+---------+-----------+------------+-------------------------------------------------------+
| 12:70636673:70637092:clu_42156_NA | 12 | 70636674 | 70637092 | + | 12_70636829_G_A_b37 | 12 | 70636829 | 70636829 | 3.06558e-18 | -1.31573 | 0.000999001 | 2.3597e-14 | 4.17519e-12 | 112000 | + | 4848 | CNOT2 | NULL |
| 12:113355505:113357194:clu_43113_NA | 12 | 113355506 | 113357194 | + | 12_113361443_G_A_b37 | 12 | 113361443 | 113361443 | 1.84858e-15 | -0.931698 | 0.000999001 | 2.45773e-13 | 3.74453e-11 | 25252 | + | 4938 | OAS1 | NULL |
| 12:70636673:70636846:clu_42156_NA | 12 | 70636674 | 70636846 | + | 12_70438852_A_C_b37 | 12 | 70438852 | 70438852 | 3.99723e-15 | 1.17823 | 0.000999001 | 5.18063e-12 | 6.33583e-10 | 112000 | + | 4848 | CNOT2 | NULL |
| 16:86581174:86581641:clu_50252_NA | 16 | 86581175 | 86581641 | + | 16_86581191_G_A_b37 | 16 | 86581191 | 86581191 | 2.06227e-14 | 1.8007 | 0.000999001 | 3.59828e-11 | 3.84513e-09 | 25060 | - | 64779 | MTHFSD | NULL |
| 1:34336095:34336473:clu_30740_NA | 1 | 34336096 | 34336473 | + | 1_34349815_C_A_b37 | 1 | 34349815 | 34349815 | 1.40127e-12 | -0.863764 | 0.000999001 | 1.03633e-09 | 8.71569e-08 | 651835 | - | 114784 | CSMD2 | NULL |
| 1:34336095:34336473:clu_30740_NA | 1 | 34336096 | 34336473 | + | 1_34349815_C_A_b37 | 1 | 34349815 | 34349815 | 1.40127e-12 | -0.863764 | 0.000999001 | 1.03633e-09 | 8.71569e-08 | 16503 | + | 402779 | CSMD2-AS1 | NULL |
| 15:85200773:85201227:clu_16999_NA | 15 | 85200774 | 85201227 | + | 15_85388653_A_G_b37 | 15 | 85388653 | 85388653 | 2.80062e-12 | -0.867156 | 0.000999001 | 2.12775e-09 | 1.69426e-07 | 3443 | - | 4828 | NMB | NULL |
| 3:141724386:141747421:clu_68161_NA | 3 | 141724387 | 141747421 | + | 3_141752480_G_C_b37 | 3 | 141752480 | 141752480 | 5.08441e-12 | -1.30272 | 0.000999001 | 3.42692e-09 | 2.63878e-07 | 205117 | - | 7029 | TFDP2 | NULL |
| 15:85198640:85199878:clu_16998_NA | 15 | 85198641 | 85199878 | + | 15_85403496_G_A_b37 | 15 | 85403496 | 85403496 | 5.69043e-12 | -0.871396 | 0.000999001 | 1.8331e-08 | 1.25049e-06 | 3443 | - | 4828 | NMB | NULL |
| 16:57474895:57481254:clu_49288_NA | 16 | 57474896 | 57481254 | + | 16_57474424_A_G_b37 | 16 | 57474424 | 57474424 | 4.83337e-11 | -1.85358 | 0.000999001 | 6.29611e-08 | 3.88909e-06 | 19283 | - | 57019 | CIAPIN1 | NULL |
| 12:48178000:48178478:clu_41140_NA | 12 | 48178001 | 48178478 | + | 12_48178212_G_A_b37 | 12 | 48178212 | 48178212 | 1.88119e-10 | 1.01347 | 0.000999001 | 8.38193e-08 | 5.07168e-06 | 37257 | - | 51564 | HDAC7 | NULL |
| 2:239003163:239004136:clu_58883_NA | 2 | 239003164 | 239004136 | + | 2_238995432_C_T_b37 | 2 | 238995432 | 238995432 | 2.66354e-10 | -0.663325 | 0.000999001 | 2.9865e-07 | 1.64134e-05 | 132468 | + | 100533179 | UBE2F-SCLY | NULL |
| 2:239003163:239004136:clu_58883_NA | 2 | 239003164 | 239004136 | + | 2_238995432_C_T_b37 | 2 | 238995432 | 238995432 | 2.66354e-10 | -0.663325 | 0.000999001 | 2.9865e-07 | 1.64134e-05 | 38490 | + | 51540 | SCLY | NULL |
| 2:239003163:239005442:clu_58883_NA | 2 | 239003164 | 239005442 | + | 2_238995432_C_T_b37 | 2 | 238995432 | 238995432 | 4.27119e-10 | 0.65652 | 0.000999001 | 6.02915e-07 | 3.12942e-05 | 132468 | + | 100533179 | UBE2F-SCLY | NULL |
| 2:239003163:239005442:clu_58883_NA | 2 | 239003164 | 239005442 | + | 2_238995432_C_T_b37 | 2 | 238995432 | 238995432 | 4.27119e-10 | 0.65652 | 0.000999001 | 6.02915e-07 | 3.12942e-05 | 38490 | + | 51540 | SCLY | NULL |
| 3:151492453:151645645:clu_68339_NA | 3 | 151492454 | 151645645 | + | 3_151346276_G_A_b37 | 3 | 151346276 | 151346276 | 1.28794e-07 | -1.52315 | 0.000999001 | 0.000143785 | 0.00464853 | 195075 | + | 100313773 | MIR548H2 | NULL |
| 3:151492453:151645645:clu_68339_NA | 3 | 151492454 | 151645645 | + | 3_151346276_G_A_b37 | 3 | 151346276 | 151346276 | 1.28794e-07 | -1.52315 | 0.000999001 | 0.000143785 | 0.00464853 | 14416 | + | 13 | AADAC | NULL |
| 3:151492453:151645645:clu_68339_NA | 3 | 151492454 | 151645645 | + | 3_151346276_G_A_b37 | 3 | 151346276 | 151346276 | 1.28794e-07 | -1.52315 | 0.000999001 | 0.000143785 | 0.00464853 | 14439 | + | 201651 | AADACP1 | NULL |
| 3:151492453:151645645:clu_68339_NA | 3 | 151492454 | 151645645 | + | 3_151346276_G_A_b37 | 3 | 151346276 | 151346276 | 1.28794e-07 | -1.52315 | 0.000999001 | 0.000143785 | 0.00464853 | 8446 | + | 56670 | SUCNR1 | NULL |
| 6:2959576:2969013:clu_61132_NA | 6 | 2959577 | 2969013 | + | 6_2960274_G_A_b37 | 6 | 2960274 | 2960274 | 1.92885e-07 | 2.27694 | 0.001998 | 0.00026135 | 0.0079236 | 24007 | - | 5269 | SERPINB6 | NULL |
| 2:241567257:241569366:clu_58961_NA | 2 | 241567258 | 241569366 | + | 2_241564098_C_T_b37 | 2 | 241564098 | 241564098 | 1.91207e-07 | 1.25305 | 0.001998 | 0.000482486 | 0.0136674 | 25852 | + | 2859 | GPR35 | NULL |
| 16:86566087:86575303:clu_50251_NA | 16 | 86566088 | 86575303 | + | 16_86570487_C_T_b37 | 16 | 86570487 | 86570487 | 1.03949e-07 | -1.31025 | 0.000999001 | 0.000680979 | 0.0185691 | 25060 | - | 64779 | MTHFSD | NULL |
| 7:76916243:76916757:clu_11003_NA | 7 | 76916244 | 76916757 | + | 7_76822196_C_T_b37 | 7 | 76822196 | 76822196 | 5.10724e-07 | -0.966231 | 0.001998 | 0.00111196 | 0.0284919 | 172588 | + | 57639 | CCDC146 | NULL |
| 1:223000943:223008461:clu_35389_NA | 1 | 223000944 | 223008461 | + | 1_223011601_G_C_b37 | 1 | 223011601 | 223011601 | 9.56993e-07 | 0.816968 | 0.003996 | 0.00172444 | 0.0416379 | 190907 | + | 84976 | DISP1 | NULL |
| 12:49976892:49982237:clu_41309_NA | 12 | 49976893 | 49982237 | + | 12_49977890_C_T_b37 | 12 | 49977890 | 49977890 | 1.62938e-06 | -2.35179 | 0.003996 | 0.00210494 | 0.049356 | 22776 | - | 84070 | FAM186B | NULL |
| 1:38023349:38027158:clu_30874_NA | 1 | 38023350 | 38027158 | + | 1_38052710_T_G_b37 | 1 | 38052710 | 38052710 | 9.9891e-07 | 0.969321 | 0.004995 | 0.00214908 | 0.0502214 | 9939 | + | 7802 | DNALI1 | NULL |
| 15:84705739:84706452:clu_16956_NA | 15 | 84705740 | 84706452 | + | 15_84793558_T_C_b37 | 15 | 84793558 | 84793558 | 1.56545e-06 | -0.629025 | 0.002997 | 0.00249118 | 0.0569917 | 385756 | + | 57188 | ADAMTSL3 | NULL |
| 12:129278901:129283804:clu_43748_NA | 12 | 129278902 | 129283804 | + | 12_129273021_G_A_b37 | 12 | 129273021 | 129273021 | 1.42991e-06 | 0.85648 | 0.004995 | 0.00374875 | 0.0799231 | 30803 | - | 121260 | SLC15A4 | NULL |
| 16:86581717:86582070:clu_50252_NA | 16 | 86581718 | 86582070 | + | 16_86581842_G_C_b37 | 16 | 86581842 | 86581842 | 6.25747e-07 | 1.23381 | 0.00699301 | 0.00393716 | 0.0831287 | 25060 | - | 64779 | MTHFSD | NULL |
| 12:113731154:113731911:clu_43143_NA | 12 | 113731155 | 113731911 | + | 12_113863969_C_T_b37 | 12 | 113863969 | 113863969 | 3.40292e-06 | -1.15578 | 0.004995 | 0.00468589 | 0.0957361 | 77130 | + | 53373 | TPCN1 | NULL
|
编辑3:
这是应@Balmer的要求进行的第三次更新。
mysql> UPDATE testis_sQTL SET gene_name = CASE intron_cluster
-> WHEN '12:70636673:70637092:clu_42156_NA' THEN 'CCR4-NOT transcription complex subunit 2'
-> WHEN '12:113355505:113357194:clu_43113_NA' THEN '2-5-oligoadenylate synthetase 1'
-> WHEN '12:70636673:70636846:clu_42156_NA' THEN 'CCR4-NOT transcription complex subunit 2'
-> WHEN '16:86581174:86581641:clu_50252_NA' THEN 'methenyltetrahydrofolate synthetase domain containing'
-> WHEN '1:34336095:34336473:clu_30740_NA' THEN 'CUB and Sushi multiple domains 2'
-> WHEN '1:34336095:34336473:clu_30740_NA' THEN 'CSMD2 antisense RNA 1'
-> WHEN '15:85200773:85201227:clu_16999_NA' THEN 'neuromedin B'
-> WHEN '3:141724386:141747421:clu_68161_NA' THEN 'transcription factor Dp-2'
-> WHEN '15:85198640:85199878:clu_16998_NA' THEN 'neuromedin B'
-> WHEN '16:57474895:57481254:clu_49288_NA' THEN 'cytokine induced apoptosis inhibitor 1'
-> WHEN '12:48178000:48178478:clu_41140_NA' THEN 'histone deacetylase 7'
-> WHEN '2:239003163:239004136:clu_58883_NA' THEN 'UBE2F-SCLY readthrough (NMD candidate)'
-> WHEN '2:239003163:239004136:clu_58883_NA' THEN 'selenocysteine lyase'
-> WHEN '2:239003163:239005442:clu_58883_NA' THEN 'UBE2F-SCLY readthrough (NMD candidate)'
-> WHEN '2:239003163:239005442:clu_58883_NA' THEN 'selenocysteine lyase'
-> WHEN '3:151492453:151645645:clu_68339_NA' THEN 'microRNA 548h-2'
-> WHEN '3:151492453:151645645:clu_68339_NA' THEN 'arylacetamide deacetylase'
-> WHEN '3:151492453:151645645:clu_68339_NA THEN 'arylacetamide deacetylase pseudogene 1'
'> WHEN '3:151492453:151645645:clu_68339_NA' THEN 'succinate receptor 1'
'> WHEN '6:2959576:2969013:clu_61132_NA' THEN 'serpin family B member 6'
'> WHEN '2:241567257:241569366:clu_58961_NA' THEN 'G protein-coupled receptor 35'
'> WHEN '16:86566087:86575303:clu_50251_NA' THEN 'methenyltetrahydrofolate synthetase domain containing'
'> WHEN '7:76916243:76916757:clu_11003_NA' THEN 'coiled-coil domain containing 146'
'> WHEN '1:223000943:223008461:clu_35389_NA' THEN 'dispatched RND transporter family member 1'
'> WHEN '12:49976892:49982237:clu_41309_NA' THEN 'family with sequence similarity 186 member B'
'> WHEN '1:38023349:38027158:clu_30874_NA' THEN 'dynein axonemal light intermediate chain 1'
'> WHEN '15:84705739:84706452:clu_16956_NA' THEN 'ADAMTS like 3'
'> WHEN '12:129278901:129283804:clu_43748_NA' THEN 'solute carrier family 15 member 4'
'> WHEN '16:86581717:86582070:clu_50252_NA' THEN 'methenyltetrahydrofolate synthetase domain containing'
'> WHEN '12:113731154:113731911:clu_43143_NA' THEN 'two pore segment channel 1'
'> END
'> WHERE intron_cluster IN ('12:70636673:70637092:clu_42156_NA','12:113355505:113357194:clu_43113_NA','12:70636673:70636846:clu_42156_NA','16:86581174:86581641:clu_50252_NA','1:34336095:34336473:clu_30740_NA','1:34336095:34336473:clu_30740_NA','15:85200773:85201227:clu_16999_NA','3:141724386:141747421:clu_68161_NA','15:85198640:85199878:clu_16998_NA','16:57474895:57481254:clu_49288_NA','12:48178000:48178478:clu_41140_NA','2:239003163:239004136:clu_58883_NA','2:239003163:239004136:clu_58883_NA','2:239003163:239005442:clu_58883_NA','2:239003163:239005442:clu_58883_NA','3:151492453:151645645:clu_68339_NA','3:151492453:151645645:clu_68339_NA','3:151492453:151645645:clu_68339_NA','3:151492453:151645645:clu_68339_NA','6:2959576:2969013:clu_61132_NA','2:241567257:241569366:clu_58961_NA','16:86566087:86575303:clu_50251_NA','7:76916243:76916757:clu_11003_NA','1:223000943:223008461:clu_35389_NA','12:49976892:49982237:clu_41309_NA','1:38023349:38027158:clu_30874_NA','15:84705739:84706452:clu_16956_NA','12:129278901:129283804:clu_43748_NA','16:86581717:86582070:clu_50252_NA','12:113731154:113731911:clu_43143_NA');
'>
'>
答案 0 :(得分:4)
如果要替换现有行中的NULL
值,则需要使用UPDATE
,而不是INSERT
。但是,您需要某种方式来指定每个值应更新的行。因此查询需要如下所示:
UPDATE testis_sQTL
SET gene_name = CASE someColumn
WHEN 'value1' THEN 'CCR4-NOT transcription complex subunit 2'
WHEN 'value2' THEN '2-5-oligoadenylate synthetase 1'
...
END
WHERE someColumn IN ('value1', 'value2', ...);
您需要将someColumn
替换为要匹配的列的名称,以找到适当的行,并将所有valueN
替换为相应的值。
如果someColumn
是表的唯一索引,则可以使用较短的INSERT ... ON DUPLICATE KEY UPDATE
语法:
INSERT INTO testis_sQTL (someColumn, gene_name) VALUES
('value1', 'CCR4-NOT transcription complex subunit 2'),
('value2', '2-5-oligoadenylate synthetase 1'),
('value3', 'CCR4-NOT transcription complex subunit 2'),
('value4', 'methenyltetrahydrofolate synthetase domain containing'),
('value5', 'CUB and Sushi multiple domains 2'),
...
ON DUPLICATE KEY UPDATE gene_name = VALUES(gene_name);
答案 1 :(得分:2)
如果gene_id和gene_name具有一对一的关系,为什么不简单地创建一堆如下所示的更新语句。
Update testis_sQTL SET gene_name='CCR4-NOT transcription complex subunit 2'
WHERE gene_id='corresponding gene_id with NULL';
Update testis_sQTL SET gene_name='2-5-oligoadenylate synthetase 1'
WHERE gene_id='corresponding gene_id with NULL';
.
.
and so on
答案 2 :(得分:1)
看看您拥有的值语法,根据您链接“值”部分的帖子应该像
VALUES
('CCR4-NOT transcription complex subunit 2'),
('2-5-oligoadenylate synthetase 1'),
('CCR4-NOT transcription complex subunit 2'),
('methenyltetrahydrofolate synthetase domain containing'),
('CUB and Sushi multiple domains 2'),
('CSMD2 antisense RNA 1'),
('neuromedin B'),
('transcription factor Dp-2'),
('neuromedin B'),
('cytokine induced apoptosis inhibitor 1'),
('histone deacetylase 7'),
('UBE2F-SCLY readthrough (NMD candidate)'),
('selenocysteine lyase'),
('UBE2F-SCLY readthrough (NMD candidate)'),
('selenocysteine lyase'),
('microRNA 548h-2'),
('arylacetamide deacetylase'),
('arylacetamide deacetylase pseudogene 1'),
('succinate receptor 1'),
('serpin family B member 6'),
('G protein-coupled receptor 35'),
('methenyltetrahydrofolate synthetase domain containing'),
('coiled-coil domain containing 146'),
('dispatched RND transporter family member 1'),
('family with sequence similarity 186 member B'),
('dynein axonemal light intermediate chain 1'),
('ADAMTS like 3'),
('solute carrier family 15 member 4'),
('methenyltetrahydrofolate synthetase domain containing'),
('two pore segment channel 1');
我并不是一个真正的msql专家,但是那是我在查看您链接的帖子时注意到的。
答案 3 :(得分:1)
@ chas-spenlau的答案是最接近的。如果要替换空值,则有两种不同的方法可以实现。
首先,如果表只有一个列,请执行以下操作:
DELETE FROM testis_sQTL WHERE gene_name IS NULL;
然后执行@ chas-spenlau建议的插入。
相反,如果数据库中还有其他列,则需要将每个新值与表中的现有行进行匹配。不幸的是,您没有给我们足够的信息来解决这个问题。
答案 4 :(得分:0)
我个人喜欢Barmar的答案,但是如果您试图从文件中自动生成这些命令,则可能只想编写一堆UPDATE语句:
UPDATE testis_sQTL SET gene_name = 'new value'
上述操作会将每行的gene_name设置为“新值”。显然这不是您想要的,因此您需要指定要为每一行更新的基因。因此,您想为每一行运行一个更新,例如:
UPDATE testis_sQTL SET gene_name = 'new value0' WHERE id = 0
我不知道您其余数据的样子,所以我不知道您是否要在WHERE子句中使用'id',这只是一个示例。
答案 5 :(得分:-2)
我认为以下代码片段可能有效:
INSERT INTO testis_sQTL(gene_name) VALUES(
'CCR4-NOT transcription complex subunit 2');