1

how can I get all the entries that are in table A but not in table B in Hive?

table A = jobs  (id, duration)
table B = other_jobs (id, duration)

I want all the jobs that are in A which do not appear in B, each job has a unique id something like this picture illustrates: http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702754970c-pi

Thank you!

1 Answer 1

2

Answer is:

SELECT jobs.* 
FROM jobs 
LEFT OUTER JOIN other_jobs 
ON (jobs.id = other_jobs.id) 
WHERE other_jobs.id IS NULL;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.