StateCode/Status Code Query

StateCode/Status Code Query
select Entity.Name,
stringmapstatuscode.value as statusstring,
 stringmapstatecode.value as statestring,
from StatusMap
JOIN stringmap stringmapstatuscode on StatusMap.status = stringmapstatuscode.AttributeValue
and stringmapstatuscode.ObjectTypeCode = StatusMap.ObjectTypeCode
and stringmapstatuscode.attributename = ‘statuscode’
JOIN stringmap stringmapstatecode on StatusMap.state = stringmapstatecode.AttributeValue
and stringmapstatecode.ObjectTypeCode = StatusMap.ObjectTypeCode
and stringmapstatecode.attributename = ‘statecode’
JOIN Entity on Entity.ObjectTypeCode = stringmapstatuscode.ObjectTypeCode
Entity.Name = ‘new_job’
order by StatusMap.state, statusmap.status

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: