I have vh_emp table whose table structure is(This is empty table): I am taking data from employee table as source table where I wrote some query to match with vh_emp table: SELECT e.emp_id …
Tag: oracle11g
ORA-00920: invalid relational operator while using IN operator
I have a table col where i have: select * from offc.col; I returned some data using query by year wise ans dept_id wise: SELECT dept_id, year, Max(marks) marks FROM offc.col …
Merge statement giving error on oracle when trying to merge two tables
i have a student table as : I have a stud_claim table as is : student_id is the foreign key of student table. At stud_claim table, I have paid_date column .paid_date has some data and some row is null.I need to update stu_claim table where paid_date is null and put the value of the service_date in that paid_date,if paid_date is
How to print the cursor values in oracle?
I am new to oracle and I am learning cursors.My table City has two columns city_id,city_name.So,this is what I tried: i am trying to assign the data of cursor to the newly declared value v_list SYS_REFCURSOR;.But the output is coming as error at v_list := city_list;.How can I assign all the values of cursors to the another cursor directly or
Why does the number of tuples selected vary in these queries
I am new to DBMS and SQL. While practicing some basic queries i had come across this doubt. Suppose this query’s result is null:select * from table2 b where b.age>50; i.e. there is no age in table2 …
Strange behavior of Oracle and group by
While analyzing performance of an SQL query in Oracle, I noticed a strange behavior. I noticed that Oracle’s plan behavior changes depending on value used in query. For example here is my table …
Gaps and Islands Months only
I am working with a data set of clients and their date records. I am trying to apply a gaps and island problem only using MONTHS,( currently var char ‘YYYYMM’). I need to take individual records and …
Is there a difference between Oracle SQL ‘KEEP’ for multiple columns and ‘KEEP’ for one and GROUP BY for the rest?
I’m just now learning about KEEP in Oracle SQL, but I cannot seem to find documentation that explains why their examples use KEEP in all columns that are not indexed. I have a table with 5 columns …
Way to alter one table if another was altered
For example, I am having table T1 and archive table T1_A Create table T1(n number); Create table T1_A(archieve_dt date,n number); To make activation working correctly if I am adding a column to T1 …
Why does outer reference in SQL subquery produce different results?
I run two SQL queries: The first one have an outer reference to the table inside subquery. In the second one I add the same table inside subquery. The results are different, it fails due to multiple …