2012-12-12 48 views
4
select id,pubdate, typeid,aid,jobname,jobdepart,jobplace,jobnumber,jobcontact from 
    archives right join jobrt on id=aid where typeid=19 

1,表檔案上都有的Fileds:ID,pubdate的,typeid的...1052 - 列 'typeid的' 在字段列表是不明確的

2,表jobrt字段有:援助,作業名,jobdepart,jobplace ,jobnumber可以,jobcontact,typeid的..

3,ID =援助

現在,我要選擇出來的id列作業名,jobplace comlumns時的typeid = 19,...

謝謝

回答

0

因爲兩個表:archivesjobrt包含COLUMNNAME typeID,你需要指定的值來自的表名,如

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 
0

你應該確定哪些表中選擇,類似如下:

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