I have three table that has priority for select column in SELECT statement. Suppose table A has some columns like: Table A: A_ID |name ———|——- 1 |name1 Table B: purchase |…
Tag: oracle
JPA distinct inner join with Condition on joined table
I have two tables below: I want to get the college object with list of students of a specific department. The SQL query is below: So far I have tried the below JPA query but it is returning multiple College objects. How to return a single college object with list of students with filtered department? NOTE: I …
How to search if a row is a substring of another row of the same column in Oracle
I have a table that contains millions of rows for names of customers as a column. I want to find if a part of a name exists within another row in the same column. E.g. If a row has value ‘Roger …
Oracle PL/SQL: how to execute a procedure with a varray as out parameter?
I’m writing a stored procedure that will receive a code and return one or more VARCHAR2 values. The number of values will vary according to the code the procedure receives. I don’t know if this is …
oracle get all matched occurrences from a column
I have a table, which has 2 columns: ID & JOB_Description(Text). I would like to write an oracle SQL to extract all substrings in the Description column which match a regular pattern. However, I have learnt how to extract matched substrings from a string with below SQL, but I have no idea to apply below S…
Query working in mySql and not working in Oracle
Below is the query which is working in MySQL and not working in Oracle. Here I need to get the latest Date and corresponding event from table r for every ID in Table a . ID is unique. SELECT a….
Grabbing certain columns from the rows that the MAX value occurred
So i am trying to insert only the rows that are correlated to the HOUR where the MAX value occurred . However I am grouping by Day, and later on will be grouping on week, month, year, etc. Is my …
How to populate dictionary using SQL table data
In my C# project, I have a dictionary, its values are currently static. Now I need to set to its values in dynamically. how can I do that? I have an Oracle DB table called “country” there have two columns called, ID and CountryName as follows, How can I set this table values to my dictionary? Than…
Comparing two empty Strings in Oracle SQL
Hi today I have met with weird situation. I had a where clause where was condition which returns String and I wanted to check if it’s empty or not. And when it returns empty string Oracle still treat …
Oracle: SELECT value from where clause as dummy table
after a lot of searching I unfortunately couldn’t find a solution for the following task: I need an Oracle-SQL-Query that returns the value from the WHERE-clause as the result value. This sounds easy, but I just couldn’t find out how to achieve this. Example (how it should be): Desired Result: I k…