Is there a way by which I can combine the above two queries (updating the same table) into one single query? Answer You may use a case expression to achieve this eg.
Tag: oracle10g
How to turn 5 sets of data from one column into 5 different columns
My current table looks like this CPNT_ID Org_Id Stud ID Compl_Dte Trainee Org001 101010 Nov 13, 2016 SvcTech Org001 101010 Nov 13, 2016 CrewChief Org001 101010 Nov 13, 2016 Trainee Org001 101013 Nov 13, 2016 SvcTech Org001 101013 Nov 13, 2016 Trainee Org002 101011 Nov 13, 2016 SvcTech Org002 101011 Nov 13, 2016 Trainee Org002 101012 Nov 13, 2016 This
SQL join to find relavant codes and address
Below table contain address information. Code Code1 Code2 Address DAN001 DAN004 DAN005 ABC, Newyork. DAN004 DAN004 DAN004 Delhi, India DAN005 DAN005 DAN005 Ever, Belgium Please find table details below: Each Code have associated code1 and code2 and address last column. for example: DAN001 is associated with DAN004 and DAN005. Address for DAN001 is ABC, Newyork. Address for DAN004 is Delhi,India.
How to distribute stock quantity from a single cell to different aging brackets based on the the aging brackets quantities?
We have a table with item codes and current stock quantity and quantities in aging brackets whenever they were received (1-90, 91-120, etc) as follows: I need to distribute the STOCK_AS_ON_DATE quantity in the age brackets until no balance quantity is left. Example: Item A’s STOCK_AS_ON_DATE is 40377, in A1TO90 column we can see that 4000 quantities were received, in
please find the solution of this problem. ( in PL SQL ) ——–
I’m doing an assignment and the last question states that I call the procedure from question 2 and function from question 3 and then put them in an insert clause(question 4). Write a PL/SQL Code for an anonymous block to do the following (in package): a) Get the doctor name for a given doctor id (read from keyboard) using a
Oracle: Id Not in another table
I have following two tables, airport and flying I would like to get airport_id where flying_id present in flying table but not present in airport table. I rote the following query using nested select query. Is there anyway I can improve without writing nested? Answer There are two ways. LEFT JOIN NOT EXISTS
How to make WHERE clause case insensitive in oracle sql database?
I need to fetch both “red” and “RED”. For example: I need to use both upper and lower in same statement. How can I do this? Answer You could use case insensitive parameter at session ‘NLS_SORT=BINARY_CI’. There are two parameters at session level: NLS_COMP NLS_SORT Let’s see a demo: Normal scenario: Case insensitive approach: One more example: To improve the
Joining table get the first data on first table if duplicate
Hi i have table1 and table2. table1 is the logtime table of employees and table2 is the groupcode of the employee. On table1 some employees has duplicate time in because they time in multiple time …
How to get the time difference in hours between 2 dates where dates are stored in 12 hour format in Oracle?
I have two dates : Date1: 20-Mar-2020 07:35:00 PM and Date2: 20-Mar-2020 02:42:00 PM I have written the query : SELECT ROUND(minutes / 60, 2) || ‘ Hours ‘ FROM ( SELECT (Date1 – to_date(…
Show the names of customers that have accounts SQL Query Oracle 10G
Q1 Show the names of customers that have accounts Q2 Show the customer names with the names of the employees they deal with** Answer Q1 is a simple lookup of the cust_id in junction table has: This phrases as: select the customers that have at least one entry in the has table. When it comes to Q2: your data structures