Skip to content

Tag: sql

Calculate conversion rate with the specified conditions

Here is my sample data table: ID Status 1 New 1 Processed 2 New 2 Processed 3 New 3 Processed 4 Processed 5 New What I am trying to solve here is calculate the conversion rate from Status ‘New’ to Status ‘Processed’. From the dataset, only ID no.1,2 and 3 fulfilled the requirements of …

condition where a ‘ ‘ and a ” not working

I wrote a SQL to query table mat from an oracle db where column A is not null. Column A is varchar and its default value is ‘ ‘. I wrote the sql below: But it return an empty data set. Then I ran: This query worked. So what is the reason? Thx. Answer In Oracle, ” means NULL. Any

SAME SQL regexp_extract, different impala and hive output. Why?

The same SQL command has two different output on Hive and Impala: Hive output: ff Impala output: ffff Why such difference? Please explain difference in terms of each engine’s method of processing and outputting characters space-by-space, from left to right or right to left, step by step, and the reasoni…

Extracting timestamp from timestamp with time zone Presto

Is there a native Presto function that provides support to extract the timestamp from a timestamp with time zone? Taking something like this Which returns a value of: 2022-03-13+02:00:99 UTC To: 2022-03-13+02:00:99 I couldn’t find information in the docs for this kind of support. It seems as though my o…