Skip to content

Tag: oracle

Oracle SQL select, compare 2 listagg’s values

I have two tables: one is TEXT_MSG with column ROLES, another one is USERS with column ROLES. Columns ROLES is listagg VARCHAR2, separator is : symbol. It is possible to write SQL statement with WHERE clause to get records from USERS table WHERE one or many roles from TEXT_MSG.ROLES equals role/s from USERS.R…

Using rownum in sub query on oracle 11

I have query like this.It is working properly on oracle 12. But I am using oracle 11.That query is not working on oracle 11.Therefore I changed my query like that It gives missing right paranthesis How can I solve this problem.Do you have any idea?Actually I use a variable instead on 10 number. Answer Syntax …

joining same table multiple times in Oracle

Hi I am tuning one legacy code. we have below 2 tables in a big query. I have seen in from clause first table has been used thrice and it has been outer joined with same column with same table. Can above 3 lines be handled using fnd_currencies table only once. is there any smarter way to do that? Answer

Syntax performance of INNER JOIN

Is the performance of both these examples the same? Example 1: Example 2: I am using example #2 at the moment since I am joining 15+ tables, each table with many unnecessary columns and many rows (1 million+) Answer Oracle is smart enough and does not take all columns from table 1 and join them with all colum…