I am attempting to fetch 1 row only based on unique set of IDs in another 3 columns. In my database, there are many records per date for each of a unique set of IDs in the other 3 columns (you can …
Tag: oracle
traverse to previous rows from current row in a table
I need to traverse to previous 10 rows from current row and check if all rows has codealert_hour . If all rows has alerts then display prev row alert else display null. image shows sample data. …
How do i update multiple records using MERGE statement and use max(column_value) based on previously updated records in the same statement?
I need to use the Oracle MERGE statement to update records of the table. One of the column I would like to update should be derived from MAX value of both existing records of the table and the records …
Trying to find the most recent date where a status field has changed in Oracle SQL
I have a table that shows a full history of location ID’s (LOCN_ID), which includes an ACTIVE_STATUS field showing A for active, or I for inactive. Each time a location’s active status changes, a new …
SQL: How to create a database view from tables with OneToMany Relationship?
There are three available tables and columns: Core – EmpID, EmpName 1, Yagga Boshu External – ExternalEmpID, ExternalDeptName 1 , Capegemini Position – EmpID, Dept P/S …
NULL behavior with Comoperator like ALL in Oracle SQL
https://oracle-base.com/articles/misc/all-any-some-comparison-conditions-in-sql Query 1 : Nothing is coming. But for below quesry. All records are coming while subquesry is returning is NULL same as like above query (SELECT NULL FROM DUAL ) Query 2: Please explain me why Query 1 is returning No Records but Qu…
Get length of time while status remains the same
I have a history table which looks like this: | ID | DateChanged | Status | |—-|————-|——–| | 1 | 01/01/2019 | Closed | | 1 | 05/01/2019 | Open | | 1 | 10/01/2019 | Open | | 2 …
How can I translate a query from SQL Server to Oracle?
I’m trying to migrate a simple stored procedure from SQL Server to Oracle. I have already tried a few online converters but with no success, such as the Scratch editor. Can anyone help? CREATE …
How to concatenate strings wrapped around the ‘ character
I would like to concatenate 2 strings/fields from a table into one additional attribute and have it wrapped around the “ ‘ ” character using an sql select statement in oracle. This statement select …
Need to get difference between these two as output
REQUIRED QUERY : select all memberid from query 1 having higher count than query 2 the aim is to display all memberid who were leader/organiser/helper more times than they participate in event how …