select
A.APPEAL_ID,
AT.DESCRIPTION,
GS.AMOUNT,
R.ID,
T.LONGDESCRIPTION

from APPEAL A

--Attribute tables
join APPEALATTRIBUTES AA
on AA.PARENTID = A.ID
join ATTRIBUTETYPES AT
on AT.ATTRIBUTETYPESID = AA.ATTRIBUTETYPESID
join TABLEENTRIES T
on T.TABLEENTRIESID = AA.TABLEENTRIESID

--Gift tables
join GIFTSPLIT GS
on GS.APPEALID = A.ID
join GIFT G
on G.ID = GS.GIFTID

--Constituent table
join RECORDS R
on R.ID = G.CONSTIT_ID

where
AT.DESCRIPTION = 'Appeal Test'
and
T.LONGDESCRIPTION = '2'