I am looking to estimate a queue length for historical data at the time a record enters the queue. I would like to do this by counting how many of the rows in the data set have an enter time less than the enter time of the record, and an exit time greater than the enter time of the record.
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
Postgres totals by classification per group
for example i have an orders table with a classification column. i want to get the total per classification for each city in a state for certain identified cities, for specific date. I have done the …
Group rows by the same value in the field, while matching on partial value only
I have a table that has many rows (between a few 1000s to a few million). I need my query to do the following: group results by the same part of the value in the field; order by the biggest group first. The table has mostly values that have only some part are similar (and i.e. suffix would be different).
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
count(*) doesn’t return 0
i have a sql problem ,please help me this is my query select count(category_value .list_value_id) as jobs , category_type.value as category from list_values category_type full outer join params …
SQL statement to select all dead people
I have tables: City: zip, name,… People: id, city_zip(refers to city.zip), born_time, dead_time I need to select data about cities where ALL people from that city are dead: born_time NOT NULL AND …
merge values in select
I have next part of query: SELECT types, count FROM … Result is next: types count soft 3 lite soft 2 middle soft 7 hard soft 2 other 5 what I need is to merge results …
count distinct if a condition is satisfied
I have a table which shows if a address_no has a telephone or not. To determine, i am looking at cell_phone and house_phone columns and want to write ‘no phone’ only when house_phone and cell_phone is …