ODBC Driver for REST

Build 24.0.9060

JOIN Queries

The CData ODBC Driver for REST supports standard SQL joins like the following examples.

Inner Join

An inner join selects only rows from both tables that match the join condition:

SELECT 
  [people].[personal.age] AS age, 
  [people].[personal.gender] AS gender, 
  [people].[personal.name.first] AS first_name, 
  [people].[personal.name.last] AS last_name, 
  [vehicles].[model], 
FROM 
  [people], [vehicles] 
WHERE 
  [people].[_id] = [vehicles].[people_id]

Left Join

A left join selects all rows in the FROM table and only matching rows in the JOIN table:

SELECT 
  [people].[personal.age] AS age, 
  [people].[personal.gender] AS gender, 
  [people].[personal.name.first] AS first_name, 
  [people].[personal.name.last] AS last_name, 
  [vehicles].[model], 
FROM 
  [people]
LEFT OUTER JOIN 
  [vehicles] 
ON
  [people].[_id] = [vehicles].[people_id]

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060