I have a database where each property of an object is stored on a separate line. The attached query does not return individual values โโin the redshift database, but works as expected when testing in any mysql compatible database.
SELECT DISTINCT distinct_value FROM ( SELECT uri, ( SELECT DISTINCT value_string FROM `test_organization__app__testsegment` AS X WHERE X.uri = parent.uri AND name = 'hasTestString' AND parent.value_string IS NOT NULL ) AS distinct_value FROM `test_organization__app__testsegment` AS parent WHERE uri IN ( SELECT uri FROM `test_organization__app__testsegment` WHERE name = 'types' AND value_uri_multivalue = 'Document' ) ) AS T WHERE distinct_value IS NOT NULL ORDER BY distinct_value ASC LIMIT 10000 OFFSET 0
This is not a mistake, and the behavior is deliberate, although not straightforward.
Redshift , Redshift , .. , . , SELECT DISTINCT , , , . , .
SELECT DISTINCT
? Redshift , , . , , , ETL , .
, , . , 1, 1, 2, - .
- !!
select distinct table1.col1 from table1 left outer join table2 on table1.col1 = table2.col1
, 1 dublicates
Source: https://habr.com/ru/post/1609709/More articles:how to convert gps north and gps west to lat / long in c lens - iosAmazon CloudWatchLogs putLogEvents in PHP also throws error OldLogEventEndIndex - phpAlgorithm to sum over a column with randomly selecting data from another column - sqlUse NSUserActivity and CoreSpotlight, but still set iOS8 as the deployment target - iosHow to extract all the lines between the start signal and the end signal? - rWhy can't I remove another element from the array with a pointer - c ++When you drag an object into a collision with another object in the sprite set, there is no bouncing - iosCreating a search device Hardy-Ramanujan nth number - javaPrint specific user input in java - javaConnect QT signals declared in an interface - c ++All Articles