我试图弄清楚这个SQL语句有什么问题。这是在我尝试添加到名为v3
的数据库的过程结束时,上面定义了geneSymbolIn
。我在最后WHERE
上收到错误,说这是意外的。
FROM (SELECT Probe_gene, logFC, adj_P_Value, gene, Study_ID, Group1, Group2 FROM v3.degContrastList WHERE gene = geneSymbolIn) AS CL,
(SELECT Study_ID, Disease, PMID, Time_Point, Treatment, Raw_Data FROM v3.degContrastListExperiment) AS ET,
WHERE CL.Study_ID = ET.Study_ID;
答案 0 :(得分:0)
这不是一个有效的SELECT语句,official docs在描述正确的语法方面做得非常好。
答案 1 :(得分:0)
如果您正确格式化代码,很明显您的代码出了什么问题。
FROM (
SELECT Probe_gene, logFC, adj_P_Value, gene, Study_ID, Group1, Group2
FROM v3.degContrastList
WHERE gene = geneSymbolIn
) AS CL,
(
SELECT Study_ID, Disease, PMID, Time_Point, Treatment, Raw_Data
FROM v3.degContrastListExperiment
) AS ET,
WHERE CL.Study_ID = ET.Study_ID;
首先,没有SELECT
声明。其次,在WHERE
之前有一个逗号。
答案 2 :(得分:0)
假设您的FROM
语句前面有SELECT
。
别名ET
之后和WHERE
子句之前还有一个额外的逗号不正确。
FROM (SELECT Probe_gene, logFC, adj_P_Value, gene, Study_ID, Group1, Group2
FROM v3.degContrastList
WHERE gene = geneSymbolIn) AS CL,
(SELECT Study_ID, Disease, PMID, Time_Point, Treatment, Raw_Data
FROM v3.degContrastListExperiment) AS ET
WHERE CL.Study_ID = ET.Study_ID;