简体   繁体   English

1052 - 字段列表中的列'typeid'不明确

[英]1052 - Column 'typeid' in field list is ambiguous

select id,pubdate, typeid,aid,jobname,jobdepart,jobplace,jobnumber,jobcontact from
  archives right join jobrt on id=aid where typeid=19

1, table archives have fileds: id,pubdate,typeid... 1,表档案有fileds:id,pubdate,typeid ...

2, table jobrt have fields:aid,jobname,jobdepart,jobplace,jobnumber,jobcontact, typeid.. 2,表jobrt有字段:aid,jobname,jobdepart,jobplace,jobnumber,jobcontact,typeid ..

3, id=aid 3,id =援助

now, i want to select out the id column the jobname,jobplace comlumns when typeid=19,.. 现在,我想在typeid = 19时选择id作为jobname,jobplace comlumns的id列。

thank you 谢谢

since two tables: archives and jobrt contains columnName typeID , you need to specify the tableName where the value came from, eg 由于两个表: archivesjobrt包含columnName typeID ,因此需要指定值来自的tableName,例如

SELECT    id
        , pubdate
        , jobrt.typeid
        , aid
        , jobname
        , jobdepart
        , jobplace
        , jobnumber
        , jobcontact
FROM    archives
        RIGHT JOIN jobrt
            ON archives.id = jobrt.aid
WHERE   jobrt.typeid = 19

You should identify what table in the select, something like the following: 您应该确定select中的哪个表,如下所示:

select archives.id,archives.pubdate, archives.typeid,aid,jobname,jobdepart,jobplace,jobnumber,jobcontact from
  archives right join jobrt on id=aid where typeid=19

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM