ODBC Driver for REST

Build 24.0.9062

JOIN クエリ

CData ODBC Driver for REST は次の例のような標準SQL の結合をサポートします。

内部結合

内部結合は、結合条件に合う行のみを両テーブルから選択します。

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]

左結合

左結合は、FROM テーブルのすべての行とJOIN テーブルの条件に合う行のみを選択します。

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.9062