Skip to content
Advertisement

Tag: count

How to count non-zero numbers in a comma separated string in oracle sql

Want to count non-zero numbers from a comma separated string in oracle 12.10. If my column has data as 2000,300,0,0 then count it as 2. This gives me 2000 and 300 as result but what’s next to count it. select regexp_substr(‘2000,300,0,0′,'[^,]+’,1,level) from dual connect BY to_number(regexp_substr(‘2000,300,0,0’, ‘[^,]+’,1,level)) > 0 Thanks for helping me. I know I am missing a basic

Trying to make a new table by pulling data from two tables and keep getting ‘Error: Every derived table must have its own alias’ on this query

I have an ‘Orders’ table and a ‘Records’ table. Orders table has the following columns: Records table has the following columns: I’m trying to pull and compile the following list of data but I keep getting an error message: Here’s my query: What am I doing wrong? Answer The subquery in the join needs an alias. It also needs to

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

Advertisement