I have an Oracle SQL Query I am trying to run, but it keeps returning null value for the second query below but when I use the first query it returns a value. Please can someone help me check what I may be doing wrong in query 2? Note that the date column is in the Format 21/09/2020 10:00:00 AM
Tag: oracle-sqldeveloper
Why PLSQL optimize level is not providing expected result?
I am trying to understand complier optimizations in plsql in depth. Theoretically, default optimisation level PLSQL_OPTIMIZE_LEVEL is set to 2. To get better performance, we can set it to 3. To …
Using regex in sql to define new variable
I need to derive the “new” column from the “old” column using sql and regex if possible. I’m using Oracle SQL Developer. If I were using regex in R or Python, I would use this recipe to get the “new” column: Thanks. Use this: Answer Here’s one option:
Group by expression with case statement in oracle?
I have a query with case statement in it. This query gives me error ORA-00979: not a GROUP BY expression When I remove my last case statement from select then it runs fine. Please help me in this Answer Columns that aren’t aggregated should be part of the GROUP BY clause. It means that “solution” isn’t to remove the 2nd
sql query to get employee sum and employee count
The above query gives me the data like I want the count of employees and total of each of the above columns in the below format – what function should I use for this ? Answer
SQL query to add the state value dynamically
The below query returns value such as – ‘GA’,’CA’,’AL’ Query#1 (SELECT Upper(hzg.geography_name) FROM hz_geographies HZG, hz_geography_identifiers HZGI, …
Sort by status and effective date range
Before After Is there any way to make ‘Before’ to ‘After’? if a function or procedure is required, please write one for me. please help me drop table test; create table test (employee_code varchar2(8),…
PL/SQL No data found even there should be?
I’m currently learning PL/SQL atm and I have run into an issue with one of my homework questions. In the below code, I’m getting user input for a province and isolating select results using said province in the declaration of the cursor and trying to run the visitsandtotal procedure but all I’m getting is no data found, why? user prompt
SQL transforming one row to columns with unknown number of distinct values
I have a following database And the result I want to achieve would look like so, with values for system_code columns being sum of “value” My problem is that there is over 1000 distinct values for system_code so I can’t type them by hand. Database has nearly billion entries so anything that would calculate quickly would be perfect. Answer Just
SQL – Select rows partially depending on another table
I am very new to the database and queries. I am not sure if this is very basic. Please help me to find a solution. I have two tables – subscription and customer with primary keys as subscription_id and customer_id respectively. the customer_id is foreign key pointing to customer table customer_id column. Below is a sample of table and its