I have results from same query with multiple conditions as shown below: SELECT COUNT(DISTINCT CASEID) FROM MYTABLE WHERE YR=2019 AND STATUS IN(‘W’) SELECT COUNT(DISTINCT CASEID) FROM MYTABLE WHERE …
How to set succeeding row values as empty if same with previous row
How can I convert this table: +———————+——————————-+——-+——-+ | PropertyName | Emergency | Count | Total | +———————+—…
How to use SQL function CONCAT with LIKE
I confirmed that the columns in the SQL table contain the results I’m searching for (the results being NA), but when I use the query below, no results are returned. Could I get some help with this …
Oracle Query to derive all Id’s whose balances have increased from consecutive 3 months along with there growth percent
I wanted to extract all id’s that have increased balances from last consecutive 3 months, and also display their growth percent sample data set– not all Id’s will have consecutive 3 months of data. …
Pad row with default if values not found PostgresSQL
I wanted to return the last 7 days of user_activity, but for those empty days I want to add 0 as value Say I have this table actions | id | date ———————— 67 | 123 | 2019-07-…
Stored procedure to select values in table1, Group By, Sum, then insert those values into table2
I need a stored procedure to select rows from one table, do a Group By, Sum, and then insert the results into another table with their values. I guess I’ll have to do a merge when …
Cloning tree structure with guid
I am trying to clone tree structure to another table, but the problem is original table has guid as ParentId and Id and new table or table that I want to clone has int as ParentId and Id. I am trying …
Select all completed months until certain date in SQL Server
I have a query that returns certain time series information. But since I am doing analysis for each completed month, I would like to ignore the last month information so it does not contaminate the …
Recursive query design – Oracle SQL
I am looking to create a recursive query that is able to completely map a series of replenishments, to a top level requirement. Below is some detailed information regarding my problem statement: I …
INSERT INTO failing on SQL Fiddle
I am trying to create a SQL Fiddle for creating a test database. My query is below: — schema CREATE TABLE tblInputs ( Type VARCHAR(256), Order_No VARCHAR(256), Planned_No VARCHAR(256), …