Can anyone simplify this query

Here's a DOF from two tables

1. CREATE TABLE (EMPL)
NUMBER OF SNO
ENAME VARCHAR2 (25).
USE VARCHAR2 (25).
KEY ELEMENTARY SCHOOL (SNO)
);

2. CREATE TABLE EMPL_DET)
NUMBER OF SNO
SAL VARCHAR2 (25)
);


Here are tables LMD
INSERT INTO EMPL (SNO, ENAME, JOB) VALUES (1, 'SMITH', 'CLERK');
INSERT INTO EMPL (SNO, ENAME, JOB) VALUES (2, 'SMITH', 'MANAGER');
INSERT INTO EMPL (SNO, ENAME, JOB) VALUES (3, 'TOM', 'CLK');

INSERT INTO EMPL_DET (SNO, SAL) VALUES (1, '1000');
INSERT INTO EMPL_DET (SNO, SAL) VALUES (2, "10000");
INSERT INTO EMPL_DET (SNO, SAL) VALUES (3, '900');


I want to calculate TotalSAL (column: empl_det.) SAL) of each employee (empl.ename) with job-description (empl.job).

Means I want following the lines of output
1.(Job,TotalSAL,Ename)-> (CLERK, 11000, SMITH)
2->.(Job,TotalSAL,Ename) (MANAGER, 11000, SMITH)
3->.(Job,TotalSAL,Ename) (CLK, 900, TOM)

I tried to write down to unique ename

Select JOB, x.sal, ename in empl,
(
Select sum (sal) sal empl_det where sno in
(select sno to empl where ename = 'SMITH')
) x
where ename = 'SMITH '.
order by ename

each ename, I draw from this query. How can I make the ename list (TOM SMITH) to this request?
Or can anyone simplify this query?

Hello

in this case, you need to use is analytical functions:

that is to say:

  SELECT e.job, SUM (d.sal) OVER (PARTITION BY e.ename) AS "TotalSal"
       , e.ename
    FROM empl e, empl_det d
   WHERE d.sno = e.sno AND e.ename IN ('SMITH', 'TOM')
ORDER BY e.ename;

JOB                         TotalSal ENAME
------------------------- ---------- -------------------------
CLERK                          11000 SMITH
MANAGER                        11000 SMITH
CLK                              900 TOM                      

Kind regards.
Al

Published by: Alberto Faenza on 27 November 2012 15:34
Corrected query

Tags: Database

Similar Questions

  • Simplify this query

    When I run this query, it will be 1 hour to run it. can we change this query to do this?
    SELECT /*+ CHOOSE */a.*, b.*
      FROM (SELECT (  TO_DATE (ucraudt_new_value, 'DD-MON-YYYY')
                    - TO_DATE (ucraudt_old_value, 'DD-MON-YYYY')
                   ) AS diff,
                   ucraudt.*
              FROM ucraudt
             WHERE ucraudt_column_code = '1GED'
               AND ucraudt_new_value IS NOT NULL
               AND ucraudt_old_value IS NOT NULL
               AND ucraudt_user_id LIKE 'UCPVCRV%') a,
           ucrserv b
    WHERE a.diff > 74
       AND a.ucraudt_cust_code = b.ucrserv_cust_code
       AND a.ucraudt_prem_code = b.ucrserv_prem_code
       AND b.ucrserv_status_ind = 'A'

    Try following

    SELECT
         a.*, b.*
    FROM
           ucraudt a,
           ucrserv b
     WHERE (TO_DATE (a.ucraudt_new_value, 'DD-MON-YYYY') - TO_DATE (a.ucraudt_old_value, 'DD-MON-YYYY'))  > 74
       AND a.ucraudt_cust_code = b.ucrserv_cust_code
       AND a.ucraudt_prem_code = b.ucrserv_prem_code
       AND b.ucrserv_status_ind = 'A'
       and a.ucraudt_column_code = '1GED'
       AND a.ucraudt_new_value IS NOT NULL
       AND a.ucraudt_old_value IS NOT NULL
       AND a.ucraudt_user_id LIKE 'UCPVCRV%' 
    

    Also post the query execution plan

  • [8i] not to simplify this query?

    In my application, I need to pick up three possible prices for each part number in an array.
    The three possible prices that I need to recover are:
    (1) the price paid on the order more recently closed,
    (2) the price mentioned on the first pending order, and
    (3) the price on the furthest on pending order.

    However, there is a complication in that. Orders include the part number, but may also include a prefix of 4 characters (always the same) on a reference number which should be treated the same as the reference database. For example, "DSB-part1" should be considered "part1", "DSB-part2" should be regarded as 'part 2', etc.

    In addition, it is quite possible for several orders expected or closed on the same day, and I want to only return the price of one of these lines for each of the 3 methods of pricing.

    (Technically, there is another level of complication to this, but if I have problems with it later, I'll create a new job for him...)

    Some examples of data:
    CREATE TABLE     part
    (     part_no          VARCHAR2(9)     NOT NULL,
         part_desc     VARCHAR2(25),
         qty_instock     NUMBER,
         CONSTRAINT part_pk PRIMARY KEY (part_no)
    );
    
    INSERT INTO     part
    VALUES ('part1    ','description 1 here',5);
    INSERT INTO     part
    VALUES ('part2    ','description 2 here',10);
    INSERT INTO     part
    VALUES ('part3    ','description 3 here',0);
    
    CREATE TABLE     ords
    (     ord_no               NUMBER NOT NULL,
         ord_part_no          VARCHAR2(9),
         date_closed          DATE,
         orig_dock_date          DATE,
         date_due_instock     DATE,
         unit_price          NUMBER,
         qty_order          NUMBER,
         ord_stat          VARCHAR2(2),
         CONSTRAINT ords_pk PRIMARY KEY (ord_no)
    );
    
    INSERT INTO     ords
    VALUES (1,'part1    ',To_Date('01/01/2009','mm/dd/yyyy'),To_Date('12/01/2008','mm/dd/yyyy'),To_Date('12/15/2008','mm/dd/yyyy'),100,10,'CL');
    INSERT INTO     ords
    VALUES (2,'part1    ',To_Date('01/31/2009','mm/dd/yyyy'),To_Date('01/01/2009','mm/dd/yyyy'),To_Date('01/05/2009','mm/dd/yyyy'),105,15,'CL');
    INSERT INTO     ords
    VALUES (3,'part1    ',To_Date('01/31/2009','mm/dd/yyyy'),To_Date('01/15/2009','mm/dd/yyyy'),To_Date('01/20/2009','mm/dd/yyyy'),100,20,'CL');
    INSERT INTO     ords
    VALUES (4,'part1    ',To_Date('12/31/1900','mm/dd/yyyy'),To_Date('01/15/2009','mm/dd/yyyy'),To_Date('01/25/2009','mm/dd/yyyy'),103,10,'OP');
    INSERT INTO     ords
    VALUES (5,'ORD-part1',To_Date('12/31/1900','mm/dd/yyyy'),To_Date('01/20/2009','mm/dd/yyyy'),To_Date('01/31/2009','mm/dd/yyyy'),101,10,'OP');
    
    INSERT INTO     ords
    VALUES (6,'ORD-part2',To_Date('01/01/2009','mm/dd/yyyy'),To_Date('12/01/2008','mm/dd/yyyy'),To_Date('12/15/2008','mm/dd/yyyy'),100,10,'CL');
    INSERT INTO     ords
    VALUES (7,'part2    ',To_Date('01/31/2009','mm/dd/yyyy'),To_Date('01/01/2009','mm/dd/yyyy'),To_Date('01/05/2009','mm/dd/yyyy'),105,15,'CL');
    INSERT INTO     ords
    VALUES (8,'ORD-part2',To_Date('01/31/2009','mm/dd/yyyy'),To_Date('01/15/2009','mm/dd/yyyy'),To_Date('01/20/2009','mm/dd/yyyy'),100,20,'CL');
    INSERT INTO     ords
    VALUES (9,'part2    ',To_Date('12/31/1900','mm/dd/yyyy'),To_Date('01/15/2009','mm/dd/yyyy'),To_Date('01/25/2009','mm/dd/yyyy'),103,10,'OP');
    INSERT INTO     ords
    VALUES (10,'ORD-part2',To_Date('12/31/1900','mm/dd/yyyy'),To_Date('01/20/2009','mm/dd/yyyy'),To_Date('01/31/2009','mm/dd/yyyy'),101,10,'OP');
    
    INSERT INTO     ords
    VALUES (11,'part3    ',To_Date('01/01/2009','mm/dd/yyyy'),To_Date('12/01/2008','mm/dd/yyyy'),To_Date('12/15/2008','mm/dd/yyyy'),100,10,'CL');
    INSERT INTO     ords
    VALUES (12,'part3    ',To_Date('01/31/2009','mm/dd/yyyy'),To_Date('01/01/2009','mm/dd/yyyy'),To_Date('01/05/2009','mm/dd/yyyy'),105,15,'CL');
    INSERT INTO     ords
    VALUES (13,'ORD-part3',To_Date('01/31/2009','mm/dd/yyyy'),To_Date('01/15/2009','mm/dd/yyyy'),To_Date('01/20/2009','mm/dd/yyyy'),100,20,'CL');
    INSERT INTO     ords
    VALUES (14,'ORD-part3',To_Date('12/31/1900','mm/dd/yyyy'),To_Date('01/15/2009','mm/dd/yyyy'),To_Date('01/25/2009','mm/dd/yyyy'),103,10,'OP');
    INSERT INTO     ords
    VALUES (15,'part3    ',To_Date('12/31/1900','mm/dd/yyyy'),To_Date('01/20/2009','mm/dd/yyyy'),To_Date('01/31/2009','mm/dd/yyyy'),101,10,'OP');
    And here's my ugly query to get the results I want. It can be simplified?
    SELECT     p.part_no
    ,     p.part_desc
    ,     p.qty_instock
    ,     a2.unit_price          AS last_closed_price
    ,     a2.qty_order          AS last_closed_qty
    ,     a2.date_closed          AS last_closed_date
    ,     b2.unit_price          AS first_open_price
    ,     b2.qty_order          AS first_open_qty
    ,     b2.date_due_instock     AS first_open_date
    ,     c2.unit_price          AS last_open_date
    ,     c2.qty_order          AS last_open_qty
    ,     c2.date_due_instock     AS last_open_date
    FROM     part p
    ,     (
         SELECT     lc.part_no
         ,     lc.unit_price                                             
         ,     lc.qty_order
         ,     lc.date_closed
         ,     ROW_NUMBER() OVER(PARTITION BY lc.part_no ORDER BY lc.orig_dock_date DESC)     AS rnk_nbr
         FROM     (
              SELECT     CASE
                        WHEN     SUBSTR(o.ord_part_no,1,4)     = 'ORD-'
                        THEN     SUBSTR(o.ord_part_no,5)
                        ELSE     o.ord_part_no
                   END                                        AS part_no
              ,     o.date_closed
              ,     o.orig_dock_date
              ,     o.unit_price
              ,     o.qty_order
              FROM     ords o
              ) lc     --for last closed
         ,     (
              SELECT     a.part_no
              ,     MAX(a.date_closed)     AS last_closed_date
              FROM     (
                   SELECT     CASE
                             WHEN     SUBSTR(o.ord_part_no,1,4)     = 'ORD-'
                             THEN     SUBSTR(o.ord_part_no,5)
                             ELSE     o.ord_part_no
                        END                                        AS part_no
                   ,     o.date_closed
                   FROM     ords o
                   ) a
              GROUP BY     a.part_no
              ) a1
         WHERE     lc.part_no     = a1.part_no
         AND     lc.date_closed     = a1.last_closed_date
         ) a2
    ,     (
         SELECT     fo.part_no
         ,     fo.unit_price                                             
         ,     fo.qty_order
         ,     fo.date_due_instock
         ,     ROW_NUMBER() OVER(PARTITION BY fo.part_no ORDER BY fo.orig_dock_date DESC)     AS rnk_nbr
         FROM     (
              SELECT     CASE
                        WHEN     SUBSTR(o.ord_part_no,1,4)     = 'ORD-'
                        THEN     SUBSTR(o.ord_part_no,5)
                        ELSE     o.ord_part_no
                   END                                        AS part_no
              ,     o.date_due_instock
              ,     o.orig_dock_date
              ,     o.unit_price
              ,     o.qty_order
              FROM     ords o
              WHERE     o.ord_stat     = 'OP'
              ) fo     --for first open
         ,     (
              SELECT     b.part_no
              ,     MIN(b.date_due_instock)     AS first_open_date
              FROM     (
                   SELECT     CASE
                             WHEN     SUBSTR(o.ord_part_no,1,4)     = 'ORD-'
                             THEN     SUBSTR(o.ord_part_no,5)
                             ELSE     o.ord_part_no
                        END                                        AS part_no
                   ,     o.date_due_instock
                   FROM     ords o
                   WHERE     o.ord_stat     = 'OP'
                   ) b
              GROUP BY     b.part_no
              ) b1
         WHERE     fo.part_no          = b1.part_no
         AND     fo.date_due_instock     = b1.first_open_date
         ) b2
    ,     (
         SELECT     lo.part_no
         ,     lo.unit_price                                             
         ,     lo.qty_order
         ,     lo.date_due_instock
         ,     ROW_NUMBER() OVER(PARTITION BY lo.part_no ORDER BY lo.orig_dock_date DESC)     AS rnk_nbr
         FROM     (
              SELECT     CASE
                        WHEN     SUBSTR(o.ord_part_no,1,4)     = 'ORD-'
                        THEN     SUBSTR(o.ord_part_no,5)
                        ELSE     o.ord_part_no
                   END                                        AS part_no
              ,     o.date_due_instock
              ,     o.orig_dock_date
              ,     o.unit_price
              ,     o.qty_order
              FROM     ords o
              WHERE     o.ord_stat     = 'OP'
              ) lo     --for last open
         ,     (
              SELECT     c.part_no
              ,     MAX(c.date_due_instock)     AS last_open_date
              FROM     (
                   SELECT     CASE
                             WHEN     SUBSTR(o.ord_part_no,1,4)     = 'ORD-'
                             THEN     SUBSTR(o.ord_part_no,5)
                             ELSE     o.ord_part_no
                        END                                        AS part_no
                   ,     o.date_due_instock
                   FROM     ords o
                   WHERE     o.ord_stat     = 'OP'
                   ) c
              GROUP BY     c.part_no
              ) c1
         WHERE     lo.part_no          = c1.part_no     --EDIT: changed from l1 to c1
         AND     lo.date_due_instock     = c1.last_open_date     --EDIT: changed from l1 to c1
         ) c2
    WHERE     p.part_no     = a2.part_no
    AND     a2.part_no     = b2.part_no
    AND     b2.part_no     = c2.part_no
    AND     a2.rnk_nbr     = 1
    AND     b2.rnk_nbr     = 1
    AND     c2.rnk_nbr     = 1
    And here are the results, I expect to get, according to data from the sample:
    .                         LAST_     LAST_     LAST_          FIRST_     FIRST_     FIRST_          LAST_     LAST_     LAST_
    .                    QTY_     CLOSED_     CLOSED_     CLOSED_          OPEN_     OPEN_     OPEN_          OPEN_     OPEN_     OPEN_
    PART_NO     PART_DESC          INSTOCK     PRICE     QTY     DATE          PRICE     QTY     DATE          PRICE     QTY_     DATE_
    ---------------------------------------------------------------------------------------------------------------------------------
    part1     description 1 here     5     100     20     1/31/2009     103     10     1/25/2009     101     10     1/31/2009
    part2     description 2 here     10     100     20     1/31/2009     103     10     1/25/2009     101     10     1/31/2009
    part3     description 3 here     0     100     20     1/31/2009     103     10     1/25/2009     101     10     1/31/2009
    Published by: user11033437 on February 5, 2010 08:48
    Correction of errors (see the comments in the request above for changes)

    Hello

    It is a little bit shorter than what you have posted, probably more effective and (in my opinion) much easier to debug and maintain:

    SELECT       p.part_no
    ,       p.part_desc
    ,       p.qty_instock
    ,       o.last_closed_price
    ,       o.last_closed_qty
    ,       o.last_closed_date
    ,       o.first_open_price
    ,       o.first_open_qty
    ,       o.first_open_date
    ,       o.last_open_price
    ,       o.last_open_qty
    ,       o.last_open_date
    FROM       part          p
    ,       (          -- Begin in-line view o for pivoted order data
               SELECT    part_no
               ,          MAX (CASE WHEN lc_num = 1 THEN unit_price           END)  AS last_closed_price
               ,          MAX (CASE WHEN lc_num = 1 THEN qty_order              END)  AS last_closed_qty
               ,          MAX (CASE WHEN lc_num = 1 THEN date_closed            END)  AS last_closed_date
               ,          MAX (CASE WHEN fo_num = 1
                                    AND  ord_stat = 'OP'  THEN unit_price       END)  AS first_open_price
               ,          MAX (CASE WHEN fo_num = 1
                                    AND  ord_stat = 'OP'  THEN qty_order        END)  AS first_open_qty
               ,          MAX (CASE WHEN fo_num = 1
                                    AND  ord_stat = 'OP'  THEN date_due_instock END)  AS first_open_date
               ,          MAX (CASE WHEN lo_num = 1
                                    AND  ord_stat = 'OP'  THEN unit_price       END)  AS last_open_price
               ,          MAX (CASE WHEN lo_num = 1
                                    AND  ord_stat = 'OP'  THEN qty_order        END)  AS last_open_qty
               ,          MAX (CASE WHEN lo_num = 1
                                    AND  ord_stat = 'OP'  THEN date_due_instock END)  AS last_open_date
               FROM     (       -- Begin in-line view to get lc_, fo_, lo_num
                             SELECT    gpo.*
                       ,           ROW_NUMBER () OVER ( PARTITION BY  part_no
                                                        ORDER BY        date_closed          DESC
                                          ,            ord_no               DESC
                                        )      AS lc_num
                       ,           ROW_NUMBER () OVER ( PARTITION BY  part_no
                                                        ORDER BY        CASE
                                                      WHEN  ord_stat = 'OP'
                                                      THEN  1
                                                      ELSE  2
                                                  END
                                          ,           orig_dock_date
                                          ,            ord_no
                                        )      AS fo_num
                       ,           ROW_NUMBER () OVER ( PARTITION BY  part_no
                                                        ORDER BY        CASE
                                                      WHEN  ord_stat = 'OP'
                                                      THEN  1
                                                      ELSE  2
                                                  END
                                          ,           orig_dock_date          DESC
                                          ,            ord_no               DESC
                                        )      AS lo_num
                       FROM      (       -- Begin in-line view gpo to get part_no
                                      SELECT  ords.*
                               ,       RTRIM ( CASE
                                            WHEN  ord_part_no  LIKE 'ORD-%'
                                                      THEN  SUBSTR (ord_part_no, 5)
                                                      ELSE  ord_part_no
                                                     END
                                       )               AS part_no
                               FROM       ords
                                  )     gpo   -- End in-line view gpo to get part_no
                         )      -- End in-line view to get lc_, fo_, lo_num
               GROUP BY  part_no
           ) o          -- End in-line view o for pivoted order data
    WHERE       RTRIM (p.part_no)     = o.part_no
    ORDER BY  p.part_no
    ;
    

    Whenever you want to have a WHERE clause only applies to certain columns, think about a pivot and expression BOX.

    Is there a reason to have raw triling part_no or ord_part_no?

    Published by: Frank Kulash, February 5, 2010 13:26

    After this announcement, I saw that Max had posted essentially the same query.
    In general, where the solution of Max seems more simple, I like her way better.
    The only possible exception is tested for "OP" at the derivation of the values first_open and last_open. If none of the lines to an ord_stat part_no = "OP", solution of Max will be used a the lines with another ord_stat. That does not occur in the sample data, and I don't know if this is still possible in your application, but if this is the case, I don't know this isn't what you want.

  • How can I change this query to generate a sequence

    This query
     
     select 
     SZSTCLA_PIDM, 
      SZSTCLA_TERM_CODE,
      SZSTCLA_LAST_NAME
      from SZSTCLA,SHRTGPA
     where SZSTCLA_PIDM IN ( 120125,186114)
     AND SHRTGPA_TERM_CODE = SZSTCLA_TERM_CODE
     AND  shrtgpa_pidm  = SZSTCLA_PIDM 
      AND SZSTCLA_RECORDED_EARNED_CRED > 0 
      ORDER BY SZSTCLA_TERM_CODE
    Returns the following results
    SZSTCLA_PIDM     SZSTCLA_TERM_CODE      SZSTCLA_LAST_NAME
    186114     198810     Johnson
    186114     198820     Johnson
    186114     198910     Johnson
    186114     198920     Johnson
    186114     199010     Johnson
    186114     199020     Johnson
    186114     199110     Johnson
    186114     199120     Johnson
    120125     200720     Smith
    120125     200810     Smith
    120125     200820     Smith
    120125     200910     Smith
    120125     200920     Smith
    120125     201010     Smith
    120125     201020     Smith
    120125     201110     Smith
    120125     201120     Smith
    Notice that ruptures in every szstcla_pidm, I need to change the query, so it can display a sequence number for each SZSTCLA_TERM_CODE
    so, it will be like
    SZSTCLA_PIDM     SZSTCLA_TERM_CODE      SZSTCLA_LAST_NAME                                    seq 
    186114                     198810                                     Johnson                         1
    186114                     198820                                     Johnson                         2
    186114                    198910                                     Johnson                         3
    186114                    198920                                     Johnson                         4
    186114                    199010                                     Johnson                         5
    186114                    199020                                     Johnson                         6
    186114                    199110                                     Johnson                         7
    186114                    199120                                     Johnson                         8 
    then
    SZSTCLA_PIDM     SZSTCLA_TERM_CODE      SZSTCLA_LAST_NAME                                      seq 
    
    120125                  200720                                   Smith                             1
    120125                  200810                                    Smith                             2
    120125                  200820                                   Smith                              3
    120125                  200910                                   Smith                              4
    120125                  200920                                   Smith                              5
    120125                  201010                                   Smith                              6
    120125                  201020                                   Smith                              7
    120125                  201110                                   Smith                              8
    120125                  201120                                   Smith                              9

    Looks like below, this is what you are looking for, but I can't understand why some documents are missing from the sample output

        COL1 COL2     SZSTCLT_LAST_NAME              RN
    -------- -------- ------------------------------ --
    
      120125 200920   Smith                           1
      120125 201010   Smith                           2 
    

    Maybe, if you could explain it, the query can be modified to exclude these folders as well. But, for now, downwards should suffice.

    select szstclt_pidm col1, szstclt_term_code col2, szstclt_last_name, row_number() over (partition by szstclt_pidm order by szstclt_term_code) rn
      from szstclt a
           join shrtgpt b on a.SZSTCLT_PIDM = b.SHRTGPT_PIDM and a.SZSTCLT_TERM_CODE = b.SHRTGPT_TERM_CODE
     where SZSTCLT_PIDM IN ( 120125,186114);
    
        COL1 COL2     SZSTCLT_LAST_NAME              RN
    -------- -------- ------------------------------ --
      120125 200920   Smith                           1
      120125 201010   Smith                           2
      120125 201020   Smith                           3
      120125 201110   Smith                           4
      120125 201120   Smith                           5
      186114 198810   Johnson                         1
      186114 198820   Johnson                         2
      186114 198910   Johnson                         3
      186114 198920   Johnson                         4
      186114 199010   Johnson                         5
      186114 199020   Johnson                         6
      186114 199110   Johnson                         7
      186114 199120   Johnson                         8 
    
     13 rows selected 
    
  • can anyone run this script?

    Hi all

    in order to proceed to a reconfiguration of the alarm, I need to get metricId of an alarm by default,

    the problem is, then from a previous test I accidentally deleted some of these alert, so I have to manually recreate but I can't find the metricId that match.

    So, in order to help me, can someone run this script:

    $Name = "unable to connect to the storage.

    $alarmMgr = get-view AlarmManager

    $alarms = $alarmMgr.GetAlarm ($null)

    $alarms | %{

    $alarm = get-view $_

    If ($alarm.Info.Name - eq $Name) {}

    "Write-Host-object' * $alarm.Info.Name:"-nonewline

    Write to $alarm.Info.Name

    Write-Host-object' * $alarm.Info.Expression.Expression [0]. "Metric:"-nonewline

    Write $alarm.Info.Expression.Expression [0]. Metric

    Write-Host-object' * $alarm.Info.Expression.Expression [0]. "Metric.CounterId:"-nonewline

    Write $alarm.Info.Expression.Expression [0]. Metric.CounterId

    Write-Host-object' * $alarm.Info.Expression.Expression [0]. "Metric.Instance:"-nonewline

    Write $alarm.Info.Expression.Expression [0]. Metric.Instance

    }

    }

    First of all, as is the case, a second time with $Name = "host error.

    and one last time with $Name = 'high-availability Cluster error. "

    The result of these commands will help me a lot to get my alarm

    Thanks in advance to anyone who can help me

    Here you go (host)

    and (cluster HA)

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • How to simplify this query in sql simple select stmt

    Hello

    Please simplify the query

    I want to convert this query in a single select statement. Is this possible?
    If uarserq_choice_ind is not null then

    Select ubbwbst_cust_code
    From ubbwbst,utrchoi
    Where utrchoi_prop_code=ubbwbst_cancel_prod
    Else

    Select max(utvsrvc_ranking)
    From utvsrvc,ubbwbst
    Where utvsrvc_code=ubbwbst_cancel_prod
    End if
    Select ubbwbst_cust_code as val
    From   ubbwbst,utrchoi
    Where  utrchoi_prop_code=ubbwbst_cancel_prod
    AND    uarserq_choice_ind is not null
    union all
    Select max(utvsrvc_ranking) as val
    From   utvsrvc,ubbwbst
    Where  utvsrvc_code=ubbwbst_cancel_prod
    and    uarserq_choice_ind is null
    

    Without more information, we are unable to combine the two queries in 1 without a union.
    Looks like you select values totally disperate of totally different tables

  • How can I change this query? to get the results I want

    This query
     
    select
     SHRTGPA_pidm, 
    SZSTCLA_TERM_CODE,
    SHRTGPA_GPA_HOURS
     from  szstcla,SHRTGPA
     where szstcla_pidm = 74246
    and SHRTGPA_pidm = szstcla_pidm 
    and SZSTCLA_TERM_CODE <> SZSTCLA_TERM_CODE_MATRIC
    and SHRTGPA_TERM_CODE = SZSTCLA_TERM_CODE
    Returns
    74246     201020     4
    74246     201120     4
    74246     201110     4
    74246     201210     4
    74246     201220     4
    I want to group the query will return
    74246 201020     4
    74246 201120     8
    74246 201110     12
    74246 201210     16
    201220 20

    Two copies

    Published by: Frank Kulash, November 8, 2012 11:32

  • Can you explain this query SQL - view included Inline

    The query is taken from "Oracle Database 10g: SQL Fundamentals II" page 3-7 (Chapter 3)

    I do not understand completely the following query:

    SELECT a.last_name, a.salary, a.department_id, b.salavg
    EMPLOYEE a, (SELECT department_id,
    AVG (salary) salavg
    Employees
    GROUP BY department_id) b
    WHERE a.department_id = b.department_id
    AND a.salary > b.salavg;


    The sight of inline can return multiple records. Can you please tell me step by step how does this work. I understand the concept of join tables and alias, etc. I just need to know the mechanism of the present code.


    Thank you

    Inlive view returns the average wage against each of the Department avaiable IDs. And the query returns the names of the employees in each Department having wage greater than the average salary of all employees belonging to the same Department, as it is.

    Tell Mr. Abbott and Mr. Babbitt belong to the same SALES Department and say that they are the only two in that Department.
    Assume the salary of Mr. Abbott's $ 500 and the salary of Mr. Babbitt is $ 400, the average salaries in the COMMERCIAL service would be 450.

    When the query is run in this case,
    DepartmentID of Mr. Abbott, name, salary would be returned as well as the average in that Department, because his salary is 500 $ > $450 (on average).

    HTH,
    Aswin.

    Published by: ice_cold_aswin on July 26, 2009 19:24

  • Can anyone understand this? Windows Movie Maker woes by using Windows XP.

    First of all, I was able to make a video but could not save on my computer.  Now, I can't even make a video because when I drag and drop an image to the timeline, it disappears in the preview pane.  Curiously, when I drag and drop the music to the audio timeline it plays very well.  Go figure.  Thanks for your help.

    Hi Kestal,

    Please go to the Microsoft Community Forums.
    From the description of the question, we understand that you are unable to make videos in Windows Movie maker.
    Let me go ahead and help you with the issue.
     
    Please answer these questions, which will help us to help you best.
    1. do you get an error message?
    2. don't you make changes to the computer before the show?
     
    I suggest for the link and follow the steps in the article, and check if this can help:
    Windows Movie Maker 2 closes unexpectedly after you add a title, a video transition, or a video effect

    I hope this helps. If you have any other queries/issues related to Windows, write us and we will be happy to help you further.
  • MacAir slow Yosemite 10.10.5 running. Can anyone interpret this info from Etrecheck?

    My system has been Beach balling excessively lately. I recently installed Norton AV, which may be the main issue. I ran EtreCheck, with the following result; someone knows how to interpret it, and I'd do anything other that uninstall Norton? Thank you.


    EtreCheck version: 2.9.12 (265)

    Report generated 2016-05-16 11:09:46

    Download EtreCheck from https://etrecheck.com

    Time 01:54

    Performance: Excellent

    Click the [Support] links to help with non-Apple products.

    Click [details] for more information on this line.

    Problem: Beachballing

    Hardware Information:

    MacBook Air (13 inch, mid 2011)

    [Data sheet] - [User Guide] - [warranty & Service]

    MacBook Air - model: MacBookAir4, 2

    1 1.7 GHz Intel Core i5 CPU: 2 strands

    4 GB RAM not extensible

    BANK 0/DIMM0

    OK 2 GB DDR3 1333 MHz

    BANK 1/DIMM0

    OK 2 GB DDR3 1333 MHz

    Bluetooth: Old - transfer/Airdrop2 not supported

    Wireless: en0: 802.11 a/b/g/n

    Battery: Health = Normal - Cycle count = 237

    Video information:

    Intel HD Graphics 3000

    Color LCD 1440 x 900

    Software:

    OS X Yosemite 10.10.5 (14F1605) - since the start time: about 2 days

    Disc information:

    SM128C SSD APPLE disk0: (121,33 GB) (Solid State - TRIM: Yes)

    EFI (disk0s1) < not mounted >: 210 MB

    Macintosh HD (disk0s2) /: 120,47 go-go (89,67 free)

    Recovery HD (disk0s3) < not mounted > [recovery]: 650 MB

    USB information:

    Apple internal memory card reader

    Camera FaceTime from Apple Inc. (built-in)

    Apple Inc. Apple keyboard / Trackpad

    Apple Inc. BRCM20702 hub.

    Apple Inc. Bluetooth USB host controller.

    Lightning information:

    Apple Inc. Thunderbolt_bus.

    Guardian:

    Mac App Store and identified developers

    Kernel extensions:

    / Library/Extensions

    [loading] com.symantec.kext.SymAPComm (12.9.1f13 - SDK 10.8 - 2016-05-01) [Support]

    com.Symantec.kext.FileSecurity [no charge] (12.9.1 - SDK 10.8 - 2016-05-01) [Support]

    [loading] com.symantec.kext.fw (5.6 - SDK 10.8 - 2016-05-01) [Support]

    [loading] com.symantec.kext.internetSecurity (5.7 - 10.8 SDK - 2016-05-01) [Support]

    [loading] com.symantec.kext.ips (3.10.4 - SDK 10.8 - 2016-05-01) [Support]

    [loading] com.symantec.kext.pf (5.9.1 - SDK 10.8 - 2016-05-01) [Support]

    Launch system officers:

    [loaded] 5 tasks of Apple

    [loading] 145 tasks Apple

    [operation] 46 tasks Apple

    [killed] 16 tasks Apple

    16 killed processes lack of RAM

    Launch system demons:

    [loaded] 48 tasks Apple

    [loading] 135 tasks Apple

    [operation] 63 tasks Apple

    [killed] 16 tasks Apple

    16 killed processes lack of RAM

    Launch officers:

    [loading] com.citrix.AuthManager_Mac.plist (2014-11-18) [Support]

    [operation] com.citrix.ReceiverHelper.plist (2014-11-18) [Support]

    [operation] com.citrix.ServiceRecords.plist (2014-11-18) [Support]

    [failure] com.symantec.errorreporter - periodicagent.plist (2016-05-01) [Support]

    [loading] com.symantec.nis.application.plist (2015-09-22) [Support]

    [operation] com.symantec.uiagent.application.plist (2013-01-16) [Support]

    Launch demons:

    [failure] com.adobe.fpsaud.plist (2016-04-15) [Support]

    [operation] com.symantec.deepsight - extractor.plist (2013-01-24), [Support]

    [failure] com.symantec.errorreporter - periodic.plist (2016-05-01) [Support]

    [loading] com.symantec.liveupdate.daemon.ondemand.plist (2014-09-23) [Support]

    [loading] com.symantec.liveupdate.daemon.plist (2014-09-23) [Support]

    [failure] com.symantec.nav.migrateqtf.plist (2015-09-17) [Support]

    [operation] com.symantec.sharedsettings.plist (2015-08-13) [Support]

    [operation] com.symantec.symdaemon.plist (2014-09-17) [Support]

    User launch officers:

    [loading] com.google.keystone.agent.plist (2016-03-06) [Support]

    Items in user login:

    iTunesHelper Application (/ Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)

    Agent application of file transfer Android (~/Library/Application Support/Google/Android File transfer/Android File Transfer Agent.app)

    Dropbox application (/ Applications/Dropbox.app)

    Other applications:

    [ongoing] com.getdropbox.dropbox.17072

    [ongoing] com.Google.Android.mtpagent.48312

    [loading] 360 tasks Apple

    [operation] 136 tasks Apple

    [killed] 33 tasks Apple

    Plug-ins Internet:

    CitrixICAClientPlugIn: 11.9.0 - SDK 10.9 (2014-11-18) [Support]

    QuickTime Plugin: 7.7.3 (2015-10-26)

    Flash Player: 21.0.0.226 - SDK 10.6 (2016-04-23) obsolete! Update

    FlashPlayer - 10.6: 21.0.0.226 - SDK 10.6 (2016-04-23) [Support]

    NortonInternetSecurityBF: 1.11.0 - SDK 10.6 (2016-05-01) [Support]

    Default browser: 600 - SDK 10.10 (2015-09-10)

    Safari extensions:

    Norton Internet Security - Symantec Corp. - http://macplugin.norton.com/?ext=NIS (2016-02-11)

    3rd party preference panes:

    Flash Player (2016-04-15) [Support]

    Norton\nQuickMenu (2016-05-01) [Support]

    Time Machine:

    Time Machine not configured!

    Top of page process CPU:

    28% WindowServer

    2% fontd

    kernel_task 2%

    0% loginwindow

    0% SystemUIServer

    Top of page process of memory:

    Com.apple.WebKit.WebContent (3) 971 MB

    Kernel_task 433 MB

    SymDaemon 172 MB

    Com.apple.WebKit.Plugin.64 164 MB

    Mdworker (10) 123 MB

    Virtual memory information:

    29 MB of free RAM

    3.97 GB used RAM (524 MB cache)

    132 MB used Swap

    Diagnostic information:

    May 14, 2016, 06:22:40 /Library/Logs/DiagnosticReports/SymDaemon_2016-05-14-062240_[redacted].crash

    / Library/Application Support/Symantec/*/SymDaemon.bundle/Contents/MacOS/SymDaemon

    May 13, 2016, 17:33:20 self-test - spent

    1. remove the Symantec/Norton software.

    https://support.Norton.com/SP/en/us/home/current/solutions/v64924250_EndUserProf ile_en_us #v98528077

    2. There is problem of not having enough RAM and RAM is not extensible.

    I hope that removing the software Norton will help.

    Best.

  • Can anyone verify this for me.

    Since the update to 10.11.4 I noticed that my reporting system facility section is empty.

    Path is the about this Mac > report system > software > facilities.

    Before the update, it was filled with all installs / updates dating back three years.

    I was wondering if you could check your for me, just to try and see if there is a problem with the update

    or just with me. And I was wondering why it wouldn't be.

    Thanks in advance.

    Mine is still there.

  • Apply substitutions (can anyone 'Cook' this script for me?)

    Hello world!

    Here, I plead again for something: I need a script that clears all replacements that exist in a certain paragraph of style that has been used thousands of times in a very long Indesign document.

    Thanks in advance

    Maria

    If it's just a paragraph style: use find and replace. Put the same paragraph style in both search / replace formatting of the fields and make sure that there is no text in the text don't edit fields. It seems you want to replace the style with the same exact style... but in this case, every manual control gets fried (to continue your analogy of cooking).

  • Can anyone identify this font?

    I would really appreciate if someone could tell me what font is used in the attached logo.  Thanks in advance!

    Different weight and forms of Preservative and SERVICE

    The SERVICE is normal/regular, AGCO can be extended "BOLD".

    The police is:

    Eurostile

    Microgramma aka

    Other equivalents include:

    Aldostyle, Astron, Eurogothicy, Europa, Gamma, Micro, Microsquare 721, Waltham, Euromode, Microprose

    -Herb

  • Photo Gallery can't open this picture because you do not have permission to the location of the file asscess

    I had to format my pc yesterday and I can't access my photos on my hardrive 2ndry can anyone help this is the message I get when I try to view them
    Photo Gallery can't open this picture because you do not have permission to the location of the file asscess RJ

    I recently started having the SAME problem. Windows Photo Viewer working wonder in the past months on the same exact images without any problems.

    I suspect that Microsoft update the code somewhere which pushed as an update - what is now the cause of the problem.

    As a diagnosis, I tried with the right button "open with...". "and chose the paint. The same file opened without any problem.

    All the pictures are generated for all images without problem.

    Still, Windows Photo Viewer cannot display ALL my image files. Paint has no problem.

    Similarly, right click 'open with... '. "and choose Microsoft Office 2010. Loading the image without any problems.

    If the original poster has the same success using other programs - then the problem is with the Windows Photo Viewer - Microsoft of not having it recognize permissions for the code or something.

    It's on Windows 7 Professional 64 - bit. Latest updates applied Microsoft.

  • Can anyone confirm that Edge animate is now discontinued?

    We use this in our classes. One of my colleagues today confirmed that EA development is officially abandoned, and Adobe will now focus on the export of html5 in Flash.

    Can anyone confirm this?

    Well, that's it then, I guess.

    Update on the tools and Services

    Welcome to Adobe animate CC, a new era for Flash Professional

    As expected and now officially confirmed.

    The end of the line to animate dashboard. Goodbye Edge Animate - it was good knowing you, and we are sad to see you go.

    Flash is NOT the solution for me, however. I already work with alternative tools.

Maybe you are looking for