是Mysql的新手
我想从数据库中检索包含StrainName = M18的所有列,但是收到错误。请帮帮我
SELECT *
strain.strainName,
feature.contigId,
feature.startPosition,
feature.stopPosition,
feature.orfId,
feature.orfType,
feature.funcClassification,
feature.rastId,
feature.strand
from feature,strain
where feature.id=strain.id and strainName='M18';
错误1064(42000):您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在第1行的'strain.strainName,feature.contigId,feature.startPosition,feature.stopPosition,fe'附近使用正确的语法
答案 0 :(得分:1)
您需要在*
SELECT *, -- <<====== HERE
strain.strainName,
feature.contigId,
feature.startPosition,
feature.stopPosition,
feature.orfId,
feature.orfType,
feature.funcClassification,
feature.rastId,
feature.strand
from feature,strain
where feature.id=strain.id and
strainName='M18';
答案 1 :(得分:1)
获取所有列:
SELECT * from feature,strain
where feature.id=strain.id and strainName='M18';
获取特定列:
SELECT
strain.strainName,
feature.contigId,
feature.startPosition,
feature.stopPosition,
feature.orfId,
feature.orfType,
feature.funcClassification,
feature.rastId,
feature.strand
from feature,strain
where feature.id=strain.id and
strainName='M18';