Skip to content
Advertisement

Tag: oracle11g

Partial Group Filter

Oracle 11g How can I get ALL pet_owners of FURRRY and SCALY and only earthworms and slugs ? Answer You want either of the two conditions to be met, so you need OR:

Oracle Hierarchical Query at depth level

I have a requirement to build a table from a hierarchical table. Table structure as below: emp_hier table: emp_id supervisorId 100 null 1 100 2 1 3 2 New table: I have to write a select query on the emp_heir table and the selected data should look like this: sel_emp_id rel_emp_id relation depth_lvl 100 100 self 0 100 1 My

Transpose rows to columns using multiple pivots

I am trying to transpose rows to columns without any luck . What I have now WEEK_NUMBER VAL9 VAL4 VAL5 VAL7 45 63.27% 28.58% 7.92% 0.23% 52 65.66% 26.16% 7.80% 0.38% 50 90.97% 8.45% 0.29% 0.29% 46 82.49% 12.43% 3.01% 2.06% 47 66.33% 29.53% 3.77% 0.36% 51 65.36% 31.83% 2.69% 0.11% 49 61.88% 28.29% 9.46% 0.37% 44 45.34% 45.55% 8.45%

How add more rows when find string in column Oracle

Would it be possible to add more rows base on Keyword string in SQL ? table A table B Example: Output of the SQL should be – How to find string with keyword ‘FamilyCare’ in PromotionName of table A base on promotion_code of table B? If it exist it will add more rows in output Any help with the SQL?

how to using BETWEEN in CASE

so I want to make a case where if between the year of acceptance and the current year (sysdate) it is 1 to 5 it will be rank 1 and 6 to 10 rank 2 I using the code like this But error it say ‘missing keyword’ in the when between 1 and 5 where EMPLOYEES table contains EMPLOYEE_ID,FIRST_NAME,HIRE_DATE columns

All tables consisting of numbers less than a fixed number

I am trying to find out all the tables where table names consist of numbers less than a fixed number 16284961 at the end preceded by an underscore for example LOG_16282961. Sample User_segments table: Expected Output: Query: Using above query, although I am getting my result but additionally it also includes following tables which are not required in my output:

Change + ordered to + leading

I’m trying try to find the most selective criteria to start joining in SQL. I tried this: But this + ordered is deprecated. How I can implement this query using + leading? Answer Use the leading hint and put the table aliases between parentheses in the order you want the database to join them, for example: This would tell the

Advertisement