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: oracle
Aggregate rows based on MIN flag
I’m thinking this is an easy one but the answer is escaping me. Example: I have a query returning 10 rows, some of which are identical except for the last 2 columns which are a comment and a number(…
Compare Columns from Separate Schema in SQL using TOAD Oracle
I am trying to extract data via a unique identifier from two separate schema in TOAD for Oracle using SQL. Normally, I would export to Python and work the csv from there, however, in this case, I must …
how to extract last day date of the month from this string ‘opimus_rise_issue_command_201912.txt’
i want last date of the corresponding month and year from the string expected output– Answer A few nested functions might help.
Update a column in table A based on values in table B using a CASE statement
I got a tricky question. I would have a table A that is composed of two columns A.ID and A.Cat1_Avail. The Cat1_Avail-column is empty as of now. I would like to update the values in A.Cat1Avail based on a logical question. In particular, I have another table B that is composed of B.ID and B.Feature. B.Feature…
SQL to find start and end date for an ID
I have a table with ID, start_date and end_date columns. Table: I want to write a query to get the following output: Output: Answer You can do a cumulative sum to solve this variation of the gaps-and-island problem: Demo on DB Fiddle: ID | START_DATE | END_DATE -: | :——— | :——…
1z0-071 oracle exam question which answers is correct?
Which three statements are true about the Oracle join and ANSI join syntax? The Oracle join syntax supports natural joins. The Oracle join syntax performs less well than the SQL:1999 compliant ANSI …
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_d…
SQL: calculating distances between a town and multiple other locations
I have three tables in Oracle: HOTEL: Lists the hotel number, hotel name, and the town ID of where the hotel is located. There are 5 rows here (meaning 5 hotels, but not every town has a hotel). …