[pgsql-jp: 30608] Re: Select文 join( 結合)の質問です。

Mashiki mashiki @ yanah.com
2003年 7月 28日 (月) 05:20:49 JST


 Mashikiです。

>select
> tocodcd,
> tomomei,
> shokaicd,
> 紹介者名
>from
> aaa as a inner join bbb as b
>where
> a.tomodcd = b.tomodcd;

select
 A.tocodcd,
 A.tomomei,
 A.shokaicd,
 B.tomomei as "紹介者名"
from aaa as a
join aaa as b on a.shokaicd = b.tomodcd;

みたいなことがやりたいのでは?

違う列名のものをinner joinするにはusingでなく
on 条件を使用します。



pgsql-jp メーリングリストの案内