Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CASE: CASE#, CASETYPE, COURTRULLING
- INVOLVEDIN: PERSONID#, CASE#, ROLE
- PERSON: ID#, NAME
- Persons NAME whose ROLE = 'Plaintiff' | Person NAME whose ROLE = 'Defendent' | CASE# | CASETYPE
- SELECT
- pers1.NAME, per2.NAME, cas.CASE#, cas.CaseType
- FROM LABDATAS18.InvolvedIn inv, (SELECT
- pers2.NAME
- FROM
- LABDATAS18.InvolvedIn inv2
- INNER JOIN
- LABDATAS18.PERSON pers2
- ON
- inv2.personid# = pers2.ID#
- where inv2.role = 'Defendant') per2
- INNER JOIN LABDATAS18.PERSON pers1
- on inv.personid# = pers1.ID#
- Inner Join LABDATAS18.case cas
- on inv.CASE# = cas.CASE#
- where inv.role = 'Plaintiff';
Add Comment
Please, Sign In to add comment