Appendix B. Querying-All-Occurrences-Interactions

There are many ways to query for all-occurrences interactions. This appendix utilizes the PostgreSQL EXISTS() function, which is useful when the result of the query does not need any columns from the SAMPLES table. A regular join would work as well.

Example B.1. Finding all the all-occurrences interactions


SELECT *
  FROM actor_actees
  WHERE EXISTS(SELECT 1
                 FROM samples
                 WHERE samples.sid = actor_actees.sid
                       AND (samples.sname = actor_actees.actor
                            OR samples.sname = actor_actees.actee);



Page generated: 2024-04-18T15:22:15-04:00.