Advertisement

09.05.2008 at 06:10AM PDT, ID: 23706079
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

update query difficulties.

Asked by janoxley in Oracle 10.x, SQL Query Syntax

Tags: , ,

Hi,

   I am trying to do an update query in SQL (oracle 10g)

  the table i want to update is of the form;

"FOR_DATE" DATE NOT NULL ENABLE,
"SITE" VARCHAR2(100 BYTE),
"OUC" VARCHAR2(100 BYTE),
"AREA" VARCHAR2(200 BYTE),
"FULL_NAME" VARCHAR2(300 BYTE),
"EIN" VARCHAR2(100 BYTE),
"LINE_MANAGER_EIN" VARCHAR2(100 BYTE),
"EXCEPTION" VARCHAR2(200 BYTE),
"ALIGNED" VARCHAR2(200 BYTE),
"START_TIME" DATE,
"END_TIME" DATE,
"DURATION" NUMBER,
"ADJUSTED_DURATION" NUMBER

I want to update the ADJUSTED_DURATION column with the results from another query (attached).

So, my query returns,

FOR_DATE, EIN, DURATION

Duration is the new value that i want to update the table with.
so i want to do somthing like

update TABLE
Set Adjusted_duration = (durations from my query)
where table.for_Date=myquery.for_date
and     table.ein=myquery.ein

Can't seem to get it right though.


Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
SELECT    A.FOR_DATE
,         A.EIN
,         (CASE 
           WHEN A.DURATION<420 THEN A.DURATION                    --Remove 0  minutes time due to unpaid lunch
           WHEN A.DURATION BETWEEN 420 AND 480 THEN A.DURATION-30 --Remove 30 minutes time due to unpaid lunch
           WHEN A.DURATION>480 THEN A.DURATION-60                 --Remove 60 minutes time due to unpaid lunch
           END) "DURATION"
FROM      TC_SCHEDULED_STATES_ALTE A
,         (SELECT    FOR_DATE
           ,         EIN
           ,         COUNT(*) "RECORDS_PER_PERSON"
           FROM      TC_SCHEDULED_STATES_ALTE
           WHERE     ALIGNED<>'DAY OFF'
           GROUP BY  FOR_DATE
           ,         EIN
           HAVING    COUNT(*)=1) B
WHERE     A.FOR_DATE=B.FOR_DATE
AND       A.EIN=B.EIN
[+][-]09.05.2008 at 07:01AM PDT, ID: 22398995

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 07:13AM PDT, ID: 22399138

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 07:36AM PDT, ID: 22399384

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 07:54AM PDT, ID: 22399617

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 11:42AM PDT, ID: 22402251

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle 10.x, SQL Query Syntax
Tags: oracle, oracle 10g, sql
Sign Up Now!
Solution Provided By: slightwv
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080924-EE-VQP-38 / EE_QW_2_20070628