select
	a.mhno,
	m90.nm as mhnm,
	a.apid,
	a.apnm,
	a.apat0,
	a.apat1,
	a.apat2,
	a.apat3,
	a.apat4,
	a.apat5,
	a.apat6,
	a.apat7,
	a.apat8,
	a.apat9
from afm90 m90, axm993a a
where(
	(:mhno is null and a.mhno is not null)
	or
	(:mhno is not null and a.mhno = :mhno)
	)
	and a.mhno = m90.scls1(+) and m90.cls(+) = 'T'
order by a.mhno,a.apid
