即使我使用Select Distinct,查询结果仍显示重复项

时间:2019-05-07 22:40:34

标签: sql join select distinct redash

由于某种原因,即使我使用Select Distinct,我仍然得到重复的结果。我试图从4个表中提取查询结果。如果有人能给我任何帮助解决此问题的见解或提示,请帮助!

SELECT DISTINCT org.salesforce_ecg_id AS "ECG",
                app.name AS "App Name",
                event.a_bundleversion AS "Bundle Version",
                feed.feed_type AS "Feed Type",
                app.use_dynamic_home_screen AS "Use DHS",
                app.publish_dynamic_home_screen AS "Publish DHS"
FROM production_dynamo.applications AS app
INNER JOIN awsma.event AS event ON app.uuid = event.a_uuid
INNER JOIN production_dynamo.organizations AS org ON app.organization = org.uuid
INNER JOIN
  (SELECT DISTINCT *
   FROM production_dynamo.containers AS container
   INNER JOIN production_dynamo.feeds AS feed ON container.uuid = feed.container) AS feed ON app.uuid = feed.application
WHERE app.use_dynamic_home_screen = TRUE
  AND app.publish_dynamic_home_screen = TRUE
  AND (event.a_bundleversion LIKE '9.0%'
       OR event.a_bundleversion LIKE '9.1%'
       OR event.a_bundleversion LIKE '9.2%'
       OR event.a_bundleversion LIKE '9.3%'
       OR event.a_bundleversion LIKE '9.4%')
  AND feed.feed_type LIKE '%vimeo'

0 个答案:

没有答案