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

1、table archives有fileds:id,pubdate,typeid...

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

3、id=aid

现在,我想在typeid = 19时选择id列jobname,jobplace comlumns,..

谢谢你

4

2 回答 2

0

由于两个表: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
于 2012-12-12T02:58:19.787 回答
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
于 2012-12-12T03:00:47.610 回答