0

我正在运行一个 sql,我得到了错误。

insert into pfam_uniprot (UniProtKB-AC, UniProtKB-ID, GeneID, RefSeq, GI, PDB, GO, IPI, UniRef100, UniRef90, UniRef50, UniParc, PIR, NCBI-taxon, MIM, UniGene, PubMed, EMBL, EMBL-CDS, Ensemble, Ensemble-TRS, Ensemble-PRO, Additional_PubMed) values ("Q6GZX4", "001R_FRG3G", "2947773", "YP_031579.1", "81941549,47060116,49237298", "", "GO:0006355,GO:0046782,GO:0006351", "", "UniRef100_Q6GZX4", "UniRef90_Q6GZX4", "UniRef50_Q6GZX4", "UPI00003B0FD4", "", "654924", "", "", "15165820", "AY548484", "AAT09660.1", "", "", "", "")

我收到错误消息:

(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-AC, UniProtKB-ID, GeneID, RefSeq, GI, PDB, GO, IPI, UniRef100, UniRef90, UniRef' at line 1")I am not able to understand. Can anyone let me know.

谢谢

4

2 回答 2

1

变量名中不能有连字符。你需要逃离他们。我会对变量名使用双引号,对字符串值使用单引号:

insert into pfam_uniprot values ("UniProtKB-AC", "UniProtKB-ID", GeneID, RefSeq, GI, PDB, GO,
                                 IPI, UniRef100, UniRef90, UniRef50, UniParc, PIR, "NCBI-taxon",
                                 MIM, UniGene, PubMed, EMBL, "EMBL-CDS", Ensemble, "Ensemble-TRS",
                                 "Ensemble-PRO", Additional_PubMed
                                )
    values ('Q6GZX4', '001R_FRG3G', '2947773', 'YP_031579.1', '81941549,47060116,49237298', '',
            'GO:0006355,GO:0046782,GO:0006351', '', 'UniRef100_Q6GZX4', 'UniRef90_Q6GZX4',
            'UniRef50_Q6GZX4', 'UPI00003B0FD4', '', '654924', '', '', '15165820', 'AY548484',
            'AAT09660.1', '', '', '', '');
于 2013-08-27T15:36:36.703 回答
1

删除第一个values

insert into pfam_uniprot values (
                         ^^^^^^
于 2013-08-27T15:33:30.747 回答