Let’s say I have a customer table. I need to create a select statement which will retrieve every end date of the month and compare the values for the amounts respective to the day or two after. If the amount for the day or two is different from the end date of that month, display the recent changed amount. Example
Tag: oracle
Group Records based on predefined date range in SQL (Oracle)
Is it possible to group records based on a predefined date range differences (e.g. 30 days) based on the start_date of a row and the end_date of the previous row for non-consecutive dates? I want to take the min(start_date) and max(end_date) of each group. I tried the lead and lag function with partition by in Oracle but couldn’t come up
capture the starting characters with many patterns
I need to capture the starting characters from database objects with various pattern search. I have tried using the REGEX expression ,below query i am trying and the expected data set to be. Query 1 …
Oracle SQL – Difference between AND & OR operators
what is the difference between AND and OROperators? In the online class shows that AND displays a combination of 2 different conditions whats confusing is OR does the same thing, here is an example: …
How to return a key value ONLY if ALL the foreign keys in another table have a certain status (ORACLE)
How do I return the key (not a primary key): bwb_procesinstantie_id of the table wachtbox ONLY if ALL ‘foreign key’ values in the related table status have the status = “B” Functionality: A process contains several rel_code. But the process can only be further processed if all the rel_codes have the right status…in this case ‘B’. This is the table
Oracle SQL – ORA-00936: missing expression
whats wrong about this code ? I am trying to display all data on Employee_ID & Salary column, nothing else. what am I doing wrong here ? Answer Is this what you want?
Making a pivot table group by users
I want to see user statics, so I made query: It’s working. Here is the result: But I want to make a pivot by Months (last 6 months)… Table: obj_odb_l l ->date column -> l.datum_p -> trunc(l.datum_p,’MONTH’) How can I make a pivot table ? Answer Consider adding the month expression, TRUNC(l.datum_p,’MONTH’), into above aggregate query. Then run the query
Issues with Dapper query syntax
little assistance here with my query using dapper, been getting error Message = “ORA-00936: missing expressionn” on my query. I would like to know what am I missing here? Answer Firstly with Oracle queries you need to use : instead of @ to denote a parameter placeholder. Then secondly this code: will produce an object with a property called RouteId.
how to find which rows are being overlap while finding overlap b/w the dates
How can we find the between the overlap lap b/w the dates . overlap means when start date and end date are within same range for below example row 1 has no over lap. Row 2to 5 can be considered as one set of over lap as there start date and end are over lap with themselves Row 6 &
Is there an SQL query equivalent for Disable Related Foreign Keys option available in the Oracle SQL Developer [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question TLDR: Is there a script or SQL query to mimic the functionality “Disable the related foreign keys” I am working on a project which uses