SonicBase. In-memory embedded or distributed streaming sql database

SQL Three Way Join Statement

Performs a join between three tables.


SELECT select_columns FROM table_name INNER JOIN join_table ON join_criteria INNER JOIN join_table ON join_criteria
join_table:   table to join with
join_criteria:   where clause that specifies how records must match between the tables


PreparedStatement stmt = conn.prepareStatement(
    "select id, socialsecuritynumber, memberships.personId, memberships.membershipname, resorts.resortname
    from persons inner join Memberships on = Memberships.PersonId inner join resorts on memberships.resortid = resorts.resortId
    where<2  order by desc, memberships.membershipname desc, resorts.resortname asc");

ResultSet ret = stmt.executeQuery();