Skip to content
Advertisement

Tag: impala

Find common values in many tables

I have 5 tables and I want to find the common values between them in one column. The column name differs in two tables(account_number, account,account_id). select * from db.table1 as a INNER JOIN db….

Selecting most recent rows in a SQL query

I want to join two tables, selecting the most recent rows for an ID value present in table 1. i.e. For each ID value in table 1, only return the most recently added row for an ID value. For example, table 1 looks something like this: So if the same ID value is found twice in this table, only return

Count distinct with HUE/IMPALA

I have a table in HUE like : I need to count the distinct number of ProductID’s for each ID. Something like this : I’ve tried : What I really need to do is a count(distinct) inside the analytical function. HUE doesn’t let me do this. Is there another way I can count distinct for window of rows? Answer Your

AnalysisException: subqueries are not supported in the select list

I get this error code shown in title when using this following query. I’m trying query two tables to find total patients with hearing issues and the total of those patients with hearing issues who have undergone some sort of scan (MR,SC,CT). Any help would be appreciated. Answer I tried, pls refer to below SQL – this will work in

Convert date to ISO week date

How to convert dates to ISO week date in Impala SQL? For example 2019-12-30 in the ISO week date calendar would be written as 2020-W01-1 or 2020W011 ANSWER: Marked Gordon Linoff answer as correct, as it solves the essential part of the question, the deducing of the year part of ISO week date. For the week part of the ISO

Impala SQL LEFT ANTI JOIN

Goal is to find the empid’s for a given timerange that are present in LEFT table but not in RIGHT table. I have the following two Impala queries which I ran and got different results? QUERY 1: select …

Advertisement