Getting role for logisticsElectronicAddress


i have this query

select * from logisticsElectronicAddress where logisticsElectronicAddress.Type == elAddressType &&
logisticsElectronicAddress.Description == description &&
logisticsElectronicAddress.Locator != email
join dirPartyLocation
where dirPartyLocation.Party == custTable.Party &&
dirPartyLocation.Location == logisticsElectronicAddress.Location
join dirPartyLocationRole
where dirPartyLocationRole.PartyLocation == dirPartyLocation.RecId;
join logisticsLocationRole
where logisticsLocationRole.RecId == dirPartyLocationRole.LocationRole &&
logisticsLocationRole.Name == purpose;

i need to get role for logisticsElectronicAddress, what is wrong with it ? i want to filter out so i only get logistics electronic address which has role 'Invoice'