|
問題へのリンク
一つの行を返す副問合せを列の一つとして表示
select
得意先コード,
得意先名,
郵便番号,
(
select
[[CONCAT]](
max(都道府県名),
max(市区町村名),
case max(町域名)
when '以下に掲載がない場合' then '空中庭園'
else max(町域名)
end
[[)]]
from 郵便番号マスタ
where left(郵便番号マスタ.郵便番号,3) = left(得意先マスタ.郵便番号,3)
)
as 住所
from 得意先マスタ
|
|
select
得意先コード,
得意先名,
郵便番号,
(
select
max(都道府県名) +
max(市区町村名) +
case max(町域名)
when '以下に掲載がない場合' then '空中庭園'
else max(町域名)
end
from 郵便番号マスタ
where left(郵便番号マスタ.郵便番号,3) = left(得意先マスタ.郵便番号,3)
)
as 住所
from 得意先マスタ
|
|
select
得意先コード,
得意先名,
郵便番号,
(
select
max(都道府県名) ||
max(市区町村名) ||
case max(町域名)
when '以下に掲載がない場合' then '空中庭園'
else max(町域名)
end
from 郵便番号マスタ
where substr(郵便番号マスタ.郵便番号,1,3) = substr(得意先マスタ.郵便番号,1,3)
)
as 住所
from 得意先マスタ
|
|
select
得意先コード,
得意先名,
郵便番号,
(
select
max(都道府県名) ||
max(市区町村名) ||
decode(max(町域名),
'以下に掲載がない場合','空中庭園',
max(町域名)
)
from 郵便番号マスタ
where substr(郵便番号マスタ.郵便番号,1,3) = substr(得意先マスタ.郵便番号,1,3)
)
as 住所
from 得意先マスタ
|
|