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

1, archives de table ont fileds: id, pubdate, typeid ...1052 - Colonne 'typeid' dans la liste des champs est ambigu

2, table jobrt ont des champs: l'aide, jobname, jobdepart, jobplace , jobnumber, jobcontact, typeid ..

3, id = aide

maintenant, je veux choisir la colonne id la jobname, comlumns de jobplace quand typeid = 19, ..

merci

Répondre

0

depuis deux tables: archives et jobrt contient columnName typeID, vous devez spécifier le tableName où la valeur provenait, par exemple

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

Vous devez identifier ce tableau dans la sélection, quelque chose comme ce qui suit:

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