2021年5月3日星期一

How do I report the results for a test that matches ID's across different sources?

An ID can exist in multiple SOURCE's. I need to test whether the VALUE for the same ID matches across different SOURCES. If they didn't all match across all sources, it should return FALSE.

CREATE TABLE example_table  (      SOURCE varchar(255),        ID varchar(255),      VALUE varchar(255)  );    INSERT INTO example_table (SOURCE, ID, VALUE)  VALUES ('A', 1, 55), ('A', 2, 36), ('B', 1, 55), ('B', 2, 34);  

With the code above, I would like the query to return the following:

ID    MATCH  1     TRUE  2     FALSE  

This is a bit of a "big data" problem, as there are millions of ID's and around 50 or so sources. The query is being written for Vertica 9.2.

https://stackoverflow.com/questions/67378637/how-do-i-report-the-results-for-a-test-that-matches-ids-across-different-source May 04, 2021 at 12:02PM

没有评论:

发表评论