I need to convert all rows into columns i.e. no.of columns= total no. of values in col2 and col3 related to col1. Scenario Query tried: How can I write a pivot query here? Answer use row_number() and conditional aggregation
Tag: oracle11g
Oracle – Convert datetime format
I have a temp table. It has last_update column in 2/10/2018 6:01:50 PM datetime format. How can I write THE BEST QUERY to display all information that’s updated on 02-Oct-2018 day?
How can I use rank function to solve this?
I have this data: and I want to this result: So I ve tried this: but it did not solve my problem. How can I solve this issue? thanks in advance Answer DENSE_RANK not RANK:
How can I solve this & reach better performance
We are using an ERP system, here is one sql query below – and it’s working: (it’s using an old syntax) (select last_name||’ ‘||name||’ ‘||to_char(datum_p,’DD.MM.YYYY’) from ( select co….
Execution from the statement select * into return error
Can somebody help me? I am try execute the command below in Oracle 11 and I get this error: SQL Error [905] [42000]: ORA-00905: keyword not found. Code: I read the Oracle docs and haven’t found any obvious error in my statement. https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/selectinto_statement.htm My objective is to create the table ETMP_TESTE with structure from ESAJOBJETO. I checked user permission and
how to retrieve latest data from a table
Currently I am working on a project where I need to extract latest data from a table for a report purpose. Below is the sample table structure:- Every student has several courses and course_id for …
Relational Operators Issue With Null
I am having issues with the below select statement not picking up the data when I insert a relational operator. SELECT C.FIRST_NAME, C.LAST_NAME, B.COMPANY,A.ITEMNO, A.REV, A.DESCRIP FROM ARINVT A …
Disable trigger in another db(Oracle)
Can I create a procedure that disables a trigger in another database? I mean, can I disable it with a database link? I need it for importing data into a data warehouse
How to write SQL query to find max and min salary along with employee name in Oracle
I have one employee table. Please find below the table structure along with data. I want to find the maximum salary and minimum salary along with employee name. expected output will be: To find out the maximum salary along with employee name I have written this query: And to find out the minimum salary along with employee name I have
Write a query to show ename who don’t have reporting manager in deptno 10 or 30?
This is the emp table given in Oracle SQL. And I need to display the employees who don’t have reporting manager in department 10 or 30. Answer I would use not exists: