%entities; %constants; ]>
Query Defining the ACTOR_ACTEES_W_BABOONS View: Part I SELECT events.eid AS eid , events.intid AS intid , actors.pid AS actorpid , actees.pid AS acteepid , events.behavior AS behavior , events.position AS position , events.uncertain AS uncertain , followrole(intervals.followid, actors.participant) AS actorrole , FALSE AS baboonactor , actors.participant AS actor , followrole(intervals.followid, actees.participant) AS acteerole , FALSE AS baboonactee , actees.participant AS actee , events.comment AS comment FROM events JOIN intervals ON (intervals.intid = events.intid) JOIN parts AS actors ON (actors.eid = events.eid) JOIN parts AS actees ON (actees.eid = events.eid) WHERE actors.part = 'gmi_actor' AND actees.part = 'gmi_actee' UNION SELECT events.eid AS eid , events.intid AS intid , actors.pid AS actorpid , NULL AS acteepid , events.behavior AS behavior , events.position AS position , events.uncertain AS uncertain , followrole(intervals.followid, actors.participant) AS actorrole , FALSE AS baboonactor , actors.participant AS actor , 'NF' AS acteerole , TRUE AS baboonactee , NULL::VARCHAR(gmi_animid_len) AS actee , events.comment AS comment FROM events JOIN intervals ON (intervals.intid = events.intid) JOIN parts AS actors ON (actors.eid = events.eid) WHERE actors.part = 'gmi_actor' AND events.baboon
Query Defining the ACTOR_ACTEES_W_BABOONS View: Part II UNION SELECT events.eid AS eid , events.intid AS intid , NULL AS actorpid , actees.pid AS acteepid , events.behavior AS behavior , events.position AS position , events.uncertain AS uncertain , 'NF' AS actorrole , TRUE AS baboonactor , NULL::VARCHAR(gmi_animid_len) AS actor , followrole(intervals.followid, actees.participant) AS acteerole , FALSE AS baboonactee , actees.participant AS actee , events.comment AS comment FROM events JOIN intervals ON (intervals.intid = events.intid) JOIN parts AS actees ON (actees.eid = events.eid) WHERE actees.part = 'gmi_actee' AND events.baboon;
Entity Relationship Diagram of the ACTOR_ACTEES_W_BABOONS View If we could we would display here the diagram showing how the ACTOR_ACTEES_W_BABOONS view is constructed.