This is the query

Can someone help me rewrite or debug the application

SELECT "product_number."

SUBSTR (SYS_CONNECT_BY_PATH ('comment_text', "~"), 2) comm, cnt

FROM (SELECT 'product_number', 'comment_text',

COUNT (*) NTC (PARTITION by 'product_number'),

ROW_NUMBER () OVER (PARTITION "product_number" ORDER OF SYSDATE)

Seq

FROM (SELECT "1111" AS "product_number",

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT "1111" AS "product_number."

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT ' 1113 'LIKE 'product_number',

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT ' 1114 "AS"product_number",

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT ' 1115 "AS"product_number",

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT ' 1116 "AS"product_number",

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT ' 1117 "AS"product_number",

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

OF THE DOUBLE

UNION ALL

SELECT ' 1118 "AS"product_number",

' Uncomment the line 1 ~ comment line 2 ~ comment line 3'.

AS 'comment_text '.

THE DOUBLE))

WHERE CONNECT_BY_ISLEAF = 1

START WITH seq = 1

CONNECT BY PRIOR seq + 1 = seq

AND any PREVIOUS version "product_number" = "product_number."

AND seq < = 3

wrote:

the error I get is

ORA-30004: when you use the SYS_CONNECT_BY_PATH function, cannot have seperator [sic] as part of the value of the column

the error generated is quite explicit (do not use ' ~' in the sys_connect_by_path function call)

Depending on what you want, you can use instead of SYS_CONNECT_BY_PATH LISTAGG. LISTAGG doesn't care if the delimiter is present in the data or not.

Tags: Database

Similar Questions

  • Run the query in accordance with condition

    Oracle 10g version

    Hi gurus

    I have the following data

    Examples of data

    SELECT DeptNo FROM scott.emp

    UNION ALL

    SELECT EmpNo FROM scott.emp

    ;

    Now what I want is I want to execute conditionally of those surveyed, something like below:

    If list_item = 'I', then run below

    SELECT DeptNo FROM scott.emp

    otherwise run below

    SELECT EmpNo FROM scott.emp

    End if;

    ------

    I want to keep the union all and run the query under the terms...

    Set a long tank (max 4000)

    L_WHERE_CLAUSE

    Use it in your application as a substitution variable by prefixing with &

    WHERE & L_WHERE_CLAUSE

    Assign the value into a pl/sql block (trigger, formula column)

    IF condition THEN

    L_WHERE_CLAUSE: = '1 = 1';

    ON THE OTHER

    L_WHERE_CLAUSE: = '1 = 2';

    END IF;

    Now, among the options that have been suggested to you and the information you provided, I think the solution of Solomon should be easier. Just refer to the column list_item has a link within your query variable (assuming that this and the query where list_item belongs are related, for example, there is a join between them)

    SELECT DeptNo FROM scott.emp, t

    WHERE: list_item = 'l '.

    UNION ALL

    SELECT EmpNo FROM scott.emp, t

    WHERE nvl(:list_item,'x')! = « l »

  • Query based ViewObject does pull not all attributes, when the query has 'WITH' clause

    Hello

    12.1.2 and 12.1.3 JDeveloper

    When we try to create a custom query based ViewObject, and the query clause of "with."

    So not all the columns selected in the query are appearing as attributes of the View object in the wizard.

    This is the query. And it performs very well in Toad.

    WITH dept_count AS)

    SELECT department_id, COUNT (*) AS dept_count

    Employees

    GROUP BY department_id)

    SELECT e.first_name AS employee_name,

    DC1.dept_count AS emp_dept_count,

    m.first_name AS manager_name,

    DC2.dept_count AS mgr_dept_count

    E employees,

    dept_count dc1,

    m employees,

    dept_count dc2

    WHERE e.department_id = dc1.department_id

    AND e.manager_id = m.employee_id

    AND m.department_id = dc2.department_id;

    Only the EmployeeName attribute is extracted from the query. It does not show the rest of the attributes in the VO Wizard.

    VO.png

    (I also tried to create a VO from the EntityObject class and make it editable as false, even in this case all attributes are not displayed.)

    I was wondering if something changed in 12 c?

    It works in 11.1.1.7

    (A friend of mine just asked me this).

    Thanks for any help.

    Sameer

    Jdev dislikes the syntax

    You can rewrite as

    SELECT e.first_name AS employee_name,

    DC1.dept_count AS emp_dept_count,

    m.first_name AS manager_name,

    DC2.dept_count AS mgr_dept_count

    E employees,

    (

    SELECT department_id, COUNT (*) AS dept_count

    Employees

    GROUP BY department_id) dc1,.

    m employees,

    (

    SELECT department_id, COUNT (*) AS dept_count

    Employees

    GROUP BY department_id) dc2

    WHERE e.department_id = dc1.department_id

    AND e.manager_id = m.employee_id

    AND m.department_id = dc2.department_id

    who must work and give you the same result.

    Timo

  • Help with the query

    Hi, can someone help me with the query. I try to display comm based on calculation below

    SAL < 5000 then 10%

    5000 - 10000 then 15%

    > 10000 then 20%

    This is the query

    DECLARE

    v_comm number (7.2);

    v_Name emp.ename%type;

    v_empno emp.empno%type;

    v_sal emp.sal%type;

    BEGIN

    SELECT ename, empno, sal IN

    v_Name, v_empno, v_sal

    EMP;

    v_comm: = (IF v_sal < v_sal*.10 then 5000;)

    ELSIF v_sal between 5001 AND 10000 THEN v_sal*.15;

    Of ANOTHER v_sal > 10001 THEN v_sal*.20;

    END IF ;);

    dbms_output.put_line(v_Name||) e with empno' | v_empno | "win a comm' | v_comm);

    END; /

    also tried

    DECLARE

    v_comm number (7.2);

    v_Name emp.ename%type;

    v_empno emp.empno%type;

    v_sal emp.sal%type;

    BEGIN

    SELECT ename, empno, sal IN

    v_Name, v_empno, v_sal

    EMP;

    IF v_sal < v_comm then 5000: = v_sal*.10;

    ELSIF v_sal between 5001 AND 10000 THEN v_comm: = v_sal*.15;

    Of ANOTHER v_sal > 10001 THEN v_comm: = v_sal*.20;

    END IF ;);

    dbms_output.put_line(v_Name||) e with empno' | v_empno | "win a comm' | v_comm);

    END;

    /

    Hello

    Look at the syntax of the IF in the PL/SQL manual.  Comapre to the instruction BOX and also the expression BOX.

    Perhaps, instead of an IF statement

    v_comm: = (IF v_sal<5000 then="">

    ELSIF v_sal between 5001 AND 10000 THEN v_sal*.15;

    ELSE v_sal > 10001 THEN v_sal*.20;

    END IF ;);

    you wanted to write an expression BOX, like this:

    v_comm: = BOX

    WHEN v_sal< 5000                ="" then="" v_sal="" *="">

    WHEN v_sal BETWEEN 5001 AND 10000 THEN v_sal *.15

    WHEN v_sal > 10001 THEN v_sal *.20

    END;

    Or perhaps cela:

    v_comm: = v_sal * CASE

    WHEN v_sal<=  5000="" then="">

    WHEN v_sal<= 10000="" then="">

    OF AUTRE.20

    END;

    You can also use a CASE expression in the SELECT statement.

  • How to remove the additional summary of the result of the query

    All,

    I create a derived table two tables and then join the result then using function group but the result is to summarize a number of additional time, can correct all my request. Here are the tables and relevant data.

    CREATE TABLE SHP_DW_TEMP_DEL_WEIGHT_TB

    (

    CUSTOMER_ID NUMBER DEFAULT NULL,

    NUMBER OF CARRIER_ID,

    DATE OF BILL_DATE,

    VARCHAR2 (200 BYTE) SERVICE,

    NUMBER OF WEIGHT,

    Create_date DATE default sysdate,

    SHIPPER_ID NUMBER DEFAULT NULL

    )

    CREATE TABLE SHP_DW_TEMP_DEL_SPEND_TB

    (

    CUSTOMER_ID NUMBER DEFAULT null,

    NUMBER OF CARRIER_ID,

    DATE OF BILL_DATE,

    VARCHAR2 (200 BYTE) SERVICE,

    NUMBER OF COST,

    Create_date DATE default sysdate,

    SHIPPER_ID NUMBER DEFAULT of null

    )

    CREATE TABLE SHP_DW_INTERM_TB

    (

    JAVA_SESSION_ID VARCHAR2 (1000 BYTE),

    USER_ID NUMBER,

    CUSTOMER_ID NUMBER DEFAULT NULL,

    CLIENT_NAME VARCHAR2 (100 BYTE),

    NUMBER OF CARRIER_ID,

    CARRIER_NAME VARCHAR2 (100 BYTE),

    NUMBER OF IS_LTL_CARRIER

    SHIPPER_GROUP_ID NUMBER DEFAULT NULL,

    SHIPPER_ID NUMBER DEFAULT NULL,

    SHIPPER_NAME VARCHAR2 (100 BYTE),

    CREATE_DATE DATE DEFAULT SYSDATE,

    FREIGHT_RANK NUMBER DEFAULT of null

    )

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (FEBRUARY 25, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 602, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 243, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), ' FIRST INTERNATIONAL AIRPORT THE NIGHT ', 1.8, TO_DATE (MARCH 25, 2014 04:28:29 ',' ' DD/MM/YYYY HH24:MI:SS));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 8203.5, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (4 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 2351.1, (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 2979.7, (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (FEBRUARY 25, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 8622.1, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (4 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 10358.4, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (18 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', 2899, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (FEBRUARY 25, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 2597.1, (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (4 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 121, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (18 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 9015.5, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_WEIGHT_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, WEIGHT, CREATE_DATE)

    Values

    (664, 22, TO_DATE (18 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 729, TO_DATE (MARCH 25, 2014 04:28:29 ',' DD/MM/YYYY HH24:MI:SS'));))

    COMMIT;

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (FEBRUARY 25, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 356.65, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 181.19, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), ' FIRST INTERNATIONAL AIRPORT THE NIGHT ', 134.45, TO_DATE (MARCH 21, 2014 03:13:16 ',' ' DD/MM/YYYY HH24:MI:SS));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (4 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 7267.92, (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 27755.2, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (11 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 8192.35, (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (FEBRUARY 25, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 26388.53, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (18 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 8825.98, (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (4 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 31653.45, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (FEBRUARY 25, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL PRIORITY OVERNIGHT', TO_DATE 7901.07, (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (4 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 167.73, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (18 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL FEDEX GROUND', 959.85, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    Insert into msidw. SHP_DW_TEMP_DEL_SPEND_TB

    (CUSTOMER_ID, CARRIER_ID, BILL_DATE, SERVICE, COST, CREATE_DATE)

    Values

    (664, 22, TO_DATE (18 FEBRUARY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'AIRPORT INTERNATIONAL ECONOMY' 28209.22, TO_DATE (MARCH 21, 2014 03:13:16 ',' DD/MM/YYYY HH24:MI:SS'));))

    COMMIT;

    Insert into msidw.shp_dw_interm_tb

    (java_session_id, user_id, customer_id, client_name, carrier_id, carrier_name, is_ltl_carrier, shipper_group_id, shipper_id, shipper_name, create_date, freight_rank)

    Values

    ("E52AFB0183301775CD882C214A34F54F", 18686, 664, NULL, 22,)

    "FedEx", 0, NULL, NULL, NULL,

    TO_DATE('04/05/2014_00:00:00',_'MM/DD/YYYY_HH24:MI:SS'), 0);

    Insert into msidw.shp_dw_interm_tb

    (java_session_id, user_id, customer_id, client_name, carrier_id, carrier_name, is_ltl_carrier, shipper_group_id, shipper_id, shipper_name, create_date, freight_rank)

    Values

    ("E52AFB0183301775CD882C214A34F54F", 18686, 664, NULL, 23,)

    'DHL', 0, NULL, NULL, NULL,

    TO_DATE('04/05/2014_00:00:00',_'MM/DD/YYYY_HH24:MI:SS'), 0);

    Insert into msidw.shp_dw_interm_tb

    (java_session_id, user_id, customer_id, client_name, carrier_id, carrier_name, is_ltl_carrier, shipper_group_id, shipper_id, shipper_name, create_date, freight_rank)

    Values

    ("CA5AC1C5630D70B2E80E8E2A427DA249", 18686, 664, NULL, 21,)

    'UPS', 0, NULL, NULL, NULL,

    TO_DATE('04/05/2014_00:00:00',_'MM/DD/YYYY_HH24:MI:SS'), 0);

    Insert into msidw.shp_dw_interm_tb

    (java_session_id, user_id, customer_id, client_name, carrier_id, carrier_name, is_ltl_carrier, shipper_group_id, shipper_id, shipper_name, create_date, freight_rank)

    Values

    ("CA5AC1C5630D70B2E80E8E2A427DA249", 18686, 664, NULL, 22,)

    "FedEx", 0, NULL, NULL, NULL,

    TO_DATE('04/05/2014_00:00:00',_'MM/DD/YYYY_HH24:MI:SS'), 0);

    Insert into msidw.shp_dw_interm_tb

    (java_session_id, user_id, customer_id, client_name, carrier_id, carrier_name, is_ltl_carrier, shipper_group_id, shipper_id, shipper_name, create_date, freight_rank)

    Values

    ("CA5AC1C5630D70B2E80E8E2A427DA249", 18686, 664, NULL, 23,)

    'DHL', 0, NULL, NULL, NULL,

    TO_DATE('04/05/2014_00:00:00',_'MM/DD/YYYY_HH24:MI:SS'), 0);

    Insert into msidw.shp_dw_interm_tb

    (java_session_id, user_id, customer_id, client_name, carrier_id, carrier_name, is_ltl_carrier, shipper_group_id, shipper_id, shipper_name, create_date, freight_rank)

    Values

    ("E52AFB0183301775CD882C214A34F54F", 18686, 664, NULL, 21,)

    'UPS', 0, NULL, NULL, NULL,

    TO_DATE('04/05/2014_00:00:00',_'MM/DD/YYYY_HH24:MI:SS'), 0);

    COMMIT;

    This is the query:

    SELECT

    DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M,

    DER_COST_PER_POUND_INTL_MONTH. SERVICE,

    DER_COST_PER_POUND_INTL_MONTH. WEIGHT,

    DER_SPEND_BY_SERV_INTL_MONTHLY. COST

    Of

    (

    SELECT CUSTOMER_ID, CARRIER_ID, to_char (SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE, 'MM - YY') as BILL_DATE_M,

    (CASE

    WHEN (LIKE '% GROUND INTERNATIONAL %' service

    OR service LIKE '% INTERNATIONAL HOME DELIVERY %'

    OR a service LIKE ' % international airport FEDEX GROUND-PRP %'

    OR a service LIKE ' % international airport FEDEX GROUND-RTLABEL %'

    OR a service LIKE '% international airport FEDEX GROUND %'

    OR service LIKE ' % STANDARD.

    OR service LIKE ' % worldwide %.

    )

    AND (NOT LIKE '% FEDEX INTL ECONOMY FRT %' service

    AND service NOT LIKE ' % of the ECONOMY of FEDEX INTL.

    "AND NOT AS service ' % airport % OF CARGO OF the ECONOMY".

    "AND NOT AS service ' % airport % OF the ECONOMY.

    AND NOT LIKE '% ECONOMY MAILSERVICE % INTL' service

    AND NOT LIKE «% % ECONOMY» service

    AND NOT LIKE '% FEDEX EXPRESS SAVER % INTL' service

    AND NOT LIKE '% WW SAVER %' service

    AND NOT LIKE '% CANADIAN % SAVER' service

    AND NOT LIKE '% UPS SAVER %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY FRT %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY %' service

    AND NOT LIKE '% MAILSERVICE INTL PRIORITY %' service

    AND service NOT AS '% PRIORITY % PROPOSED international airport'

    AND service NOT AS

    'INTERNATIONAL PRIORITY DIRECTDISTRIBUTION % AIRPORT %'

    AND service NOT LIKE '% ACCELERATED %.

    AND service NOT AS ' % international airport 1 DAY FREIGHT %'

    AND service NOT AS ' international airport FIRST NIGHT % %'

    AND NOT AS '% FEDEX INTERNATIONAL FIRST' service

    AND service NOT AS '% international airport MAILSERVICE-BONUS %'

    AND service NOT AS '% UNKNOWN CODE % BASIC SERVICES international airport'

    )

    THEN "ground".

    END

    ) service.

    weight,

    shipper_id

    OF SHP_DW_TEMP_DEL_WEIGHT_TB

    where

    SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE > = trunc (add_months ((CASE WHEN sysdate < next_day (trunc (sysdate, 'MY')-1, 'MONDAY'), trunc(sysdate,'MON')-1 ELSE END sysdate), - 12), "MM") and SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE < trunc (last_day (add_months ((CASE WHEN sysdate < next_day (trunc (sysdate, 'MY')-1, 'MONDAY'), trunc(sysdate,'MON')-1 ELSE END sysdate), - 1)))

    and extract (bill_date months) = 02

    and customer_id = 664

    GROUP BY

    CARRIER_ID, CUSTOMER_ID, to_char (SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE, "MM - YY"), service, weight, SHIPPER_ID

    ) DER_COST_PER_POUND_INTL_MONTH,.

    (

    SELECT CUSTOMER_ID, CARRIER_ID, to_char (SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE, 'MM - YY') as BILL_DATE_M,

    (CASE

    WHEN (LIKE '% GROUND INTERNATIONAL %' service

    OR service LIKE '% INTERNATIONAL HOME DELIVERY %'

    OR a service LIKE ' % international airport FEDEX GROUND-PRP %'

    OR a service LIKE ' % international airport FEDEX GROUND-RTLABEL %'

    OR a service LIKE '% international airport FEDEX GROUND %'

    OR service LIKE ' % STANDARD.

    OR service LIKE ' % worldwide %.

    )

    AND (NOT LIKE '% FEDEX INTL ECONOMY FRT %' service

    AND service NOT LIKE ' % of the ECONOMY of FEDEX INTL.

    "AND NOT AS service ' % airport % OF CARGO OF the ECONOMY".

    "AND NOT AS service ' % airport % OF the ECONOMY.

    AND NOT LIKE '% ECONOMY MAILSERVICE % INTL' service

    AND NOT LIKE «% % ECONOMY» service

    AND NOT LIKE '% FEDEX EXPRESS SAVER % INTL' service

    AND NOT LIKE '% WW SAVER %' service

    AND NOT LIKE '% CANADIAN % SAVER' service

    AND NOT LIKE '% UPS SAVER %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY FRT %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY %' service

    AND NOT LIKE '% MAILSERVICE INTL PRIORITY %' service

    AND service NOT AS '% PRIORITY % PROPOSED international airport'

    AND service NOT AS

    'INTERNATIONAL PRIORITY DIRECTDISTRIBUTION % AIRPORT %'

    AND service NOT LIKE '% ACCELERATED %.

    AND service NOT AS ' % international airport 1 DAY FREIGHT %'

    AND service NOT AS ' international airport FIRST NIGHT % %'

    AND NOT AS '% FEDEX INTERNATIONAL FIRST' service

    AND service NOT AS '% international airport MAILSERVICE-BONUS %'

    AND service NOT AS '% UNKNOWN CODE % BASIC SERVICES international airport'

    )

    THEN "ground".

    END

    ) service.

    COST,

    SHIPPER_ID

    OF SHP_DW_TEMP_DEL_SPEND_TB

    where

    SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE > = trunc (add_months ((CASE WHEN sysdate < next_day (trunc (sysdate, 'MY')-1, 'MONDAY'), trunc(sysdate,'MON')-1 ELSE END sysdate), - 12), "MM") and SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE < trunc (last_day (add_months ((CASE WHEN sysdate < next_day (trunc (sysdate, 'MY')-1, 'MONDAY'), trunc(sysdate,'MON')-1 ELSE END sysdate), - 1)))

    and extract (bill_date months) = 02

    and customer_id = 664

    GROUP OF CUSTOMER_ID, CARRIER_ID, to_char (SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE, "MM - YY"), service, COST, SHIPPER_ID

    ) DER_SPEND_BY_SERV_INTL_MONTHLY,.

    SHP_DW_INTERM_TB

    WHERE

    (NVL (DER_SPEND_BY_SERV_INTL_MONTHLY. CUSTOMER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. CUSTOMER_ID,-1))

    AND (DER_SPEND_BY_SERV_INTL_MONTHLY. CARRIER_ID = DER_COST_PER_POUND_INTL_MONTH. CARRIER_ID)

    AND (DER_SPEND_BY_SERV_INTL_MONTHLY. BILL_DATE_M = DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M)

    AND (DER_SPEND_BY_SERV_INTL_MONTHLY. SERVICE = DER_COST_PER_POUND_INTL_MONTH. (SERVICE) - MNKB

    AND (NVL (DER_SPEND_BY_SERV_INTL_MONTHLY. SHIPPER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. SHIPPER_ID,-1))

    AND (NVL (SHP_DW_INTERM_TB. CUSTOMER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. CUSTOMER_ID,-1))

    AND (SHP_DW_INTERM_TB. CARRIER_ID = DER_COST_PER_POUND_INTL_MONTH. CARRIER_ID)

    AND (NVL (SHP_DW_INTERM_TB. SHIPPER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. SHIPPER_ID,-1))

    AND

    (

    SHP_DW_INTERM_TB. JAVA_SESSION_ID in ('CA5AC1C5630D70B2E80E8E2A427DA249')

    AND

    SHP_DW_INTERM_TB. User_id in (18686)

    AND

    SHP_DW_INTERM_TB.IS_LTL_CARRIER (0)

    )

    GROUP BY

    DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M,

    DER_COST_PER_POUND_INTL_MONTH. WEIGHT,

    DER_SPEND_BY_SERV_INTL_MONTHLY. COST,

    DER_COST_PER_POUND_INTL_MONTH. SERVICE

    order of DER_COST_PER_POUND_INTL_MONTH.service

    The result I want is

    Billing date

    Service Weight Cost
    04/02/14
    On the ground
    121
    167.73
    11/02/14
    On the ground
    243
    181.19
    18/02/2014
    On the ground
    729
    959.85
    25/02/2014
    On the ground
    602
    356.65

    The above query gives each weight mapped to each cost, so the resulting values are summarizing to greater value than the above expected values.

    Can someone help me please how do I change my request to get my desired result.

    Kind regards

    Mr Kishore N. badin.

    SELECT DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M,

    DER_COST_PER_POUND_INTL_MONTH. SERVICE,

    DER_COST_PER_POUND_INTL_MONTH. WEIGHT,

    DER_SPEND_BY_SERV_INTL_MONTHLY. COST

    IN (SELECT CUSTOMER_ID,

    CARRIER_ID,

    TO_CHAR (SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE, 'DD-MM-YY') as BILL_DATE_M,

    BOX WHEN (LIKE '% GROUND INTERNATIONAL %' service

    OR service LIKE '% INTERNATIONAL HOME DELIVERY %'

    OR a service LIKE ' % international airport FEDEX GROUND-PRP %'

    OR a service LIKE ' % international airport FEDEX GROUND-RTLABEL %'

    OR a service LIKE '% international airport FEDEX GROUND %'

    OR service LIKE ' % STANDARD.

    OR service LIKE ' % worldwide %.

    )

    AND (NOT LIKE '% FEDEX INTL ECONOMY FRT %' service

    AND service NOT LIKE ' % of the ECONOMY of FEDEX INTL.

    "AND NOT AS service ' % airport % OF CARGO OF the ECONOMY".

    "AND NOT AS service ' % airport % OF the ECONOMY.

    AND NOT LIKE '% ECONOMY MAILSERVICE % INTL' service

    AND NOT LIKE «% % ECONOMY» service

    AND NOT LIKE '% FEDEX EXPRESS SAVER % INTL' service

    AND NOT LIKE '% WW SAVER %' service

    AND NOT LIKE '% CANADIAN % SAVER' service

    AND NOT LIKE '% UPS SAVER %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY FRT %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY %' service

    AND NOT LIKE '% MAILSERVICE INTL PRIORITY %' service

    AND service NOT AS '% PRIORITY % PROPOSED international airport'

    AND service NOT AS '% airport international PRIORITY DIRECTDISTRIBUTION %'

    AND service NOT LIKE '% ACCELERATED %.

    AND service NOT AS ' % international airport 1 DAY FREIGHT %'

    AND service NOT AS ' international airport FIRST NIGHT % %'

    AND NOT AS '% FEDEX INTERNATIONAL FIRST' service

    AND service NOT AS '% international airport MAILSERVICE-BONUS %'

    AND service NOT AS '% UNKNOWN CODE % BASIC SERVICES international airport'

    )

    THEN "ground".

    END of service,

    weight,

    shipper_id

    OF SHP_DW_TEMP_DEL_WEIGHT_TB

    where SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE > =.

    trunc (add_months (BOX WHEN sysdate< next_day(trunc(sysdate,'mon')="" -="">

    'MONDAY '.

    )

    THEN trunc (sysdate, 'MY') - 1

    Of ANOTHER sysdate

    END,

    -12

    ),

    "MM".

    )

    and SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE

    trunc (last_day (add_months (BOX WHEN sysdate< next_day(trunc(sysdate,'mon')="" -="">

    'MONDAY '.

    )

    THEN trunc (sysdate, 'MY') - 1

    Of ANOTHER sysdate

    END,

    -1

    )

    )

    )

    and extract (bill_date months) = 02

    and customer_id = 664

    GROUP CARRIER_ID,

    CUSTOMER_ID,

    TO_CHAR (SHP_DW_TEMP_DEL_WEIGHT_TB. BILL_DATE, 'DD-MM-YY'),

    service, weight, SHIPPER_ID

    ) DER_COST_PER_POUND_INTL_MONTH,.

    (SELECT CUSTOMER_ID,

    CARRIER_ID,

    TO_CHAR (SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE, 'DD-MM-YY') as BILL_DATE_M,

    BOX WHEN (LIKE '% GROUND INTERNATIONAL %' service

    OR service LIKE '% INTERNATIONAL HOME DELIVERY %'

    OR a service LIKE ' % international airport FEDEX GROUND-PRP %'

    OR a service LIKE ' % international airport FEDEX GROUND-RTLABEL %'

    OR a service LIKE '% international airport FEDEX GROUND %'

    OR service LIKE ' % STANDARD.

    OR service LIKE ' % worldwide %.

    )

    AND (NOT LIKE '% FEDEX INTL ECONOMY FRT %' service

    AND service NOT LIKE ' % of the ECONOMY of FEDEX INTL.

    "AND NOT AS service ' % airport % OF CARGO OF the ECONOMY".

    "AND NOT AS service ' % airport % OF the ECONOMY.

    AND NOT LIKE '% ECONOMY MAILSERVICE % INTL' service

    AND NOT LIKE «% % ECONOMY» service

    AND NOT LIKE '% FEDEX EXPRESS SAVER % INTL' service

    AND NOT LIKE '% WW SAVER %' service

    AND NOT LIKE '% CANADIAN % SAVER' service

    AND NOT LIKE '% UPS SAVER %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY FRT %' service

    AND NOT LIKE '% FEDEX INTL PRIORITY %' service

    AND NOT LIKE '% MAILSERVICE INTL PRIORITY %' service

    AND service NOT AS '% PRIORITY % PROPOSED international airport'

    AND service NOT AS '% airport international PRIORITY DIRECTDISTRIBUTION %'

    AND service NOT LIKE '% ACCELERATED %.

    AND service NOT AS ' % international airport 1 DAY FREIGHT %'

    AND service NOT AS ' international airport FIRST NIGHT % %'

    AND NOT AS '% FEDEX INTERNATIONAL FIRST' service

    AND service NOT AS '% international airport MAILSERVICE-BONUS %'

    AND service NOT AS '% UNKNOWN CODE % BASIC SERVICES international airport'

    )

    THEN "ground".

    END of service,

    COST,

    SHIPPER_ID

    OF SHP_DW_TEMP_DEL_SPEND_TB

    where SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE > =.

    trunc (add_months (BOX WHEN sysdate< next_day(trunc(sysdate,'mon')="" -="">

    'MONDAY '.

    )

    THEN trunc (sysdate, 'MY') - 1

    Of ANOTHER sysdate

    END,

    -12

    ),

    "MM".

    )

    and SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE

    trunc (last_day (add_months (BOX WHEN sysdate< next_day(trunc(sysdate,'mon')="" -="">

    'MONDAY '.

    )

    THEN trunc(sysdate,'MON')-1

    Of ANOTHER sysdate

    END,

    -1

    )

    )

    )

    and extract (bill_date months) = 02

    and customer_id = 664

    CUSTOMER_ID GROUP,

    CARRIER_ID,

    TO_CHAR (SHP_DW_TEMP_DEL_SPEND_TB. BILL_DATE, 'DD-MM-YY'),

    service, COST, of SHIPPER_ID

    ) DER_SPEND_BY_SERV_INTL_MONTHLY,.

    SHP_DW_INTERM_TB

    WHERE (NVL (DER_SPEND_BY_SERV_INTL_MONTHLY. CUSTOMER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. CUSTOMER_ID,-1))

    AND (DER_SPEND_BY_SERV_INTL_MONTHLY. CARRIER_ID = DER_COST_PER_POUND_INTL_MONTH. CARRIER_ID)

    AND (DER_SPEND_BY_SERV_INTL_MONTHLY. BILL_DATE_M = DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M)

    AND (DER_SPEND_BY_SERV_INTL_MONTHLY. SERVICE = DER_COST_PER_POUND_INTL_MONTH. (SERVICE) - MNKB

    AND (NVL (DER_SPEND_BY_SERV_INTL_MONTHLY. SHIPPER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. SHIPPER_ID,-1))

    AND (NVL (SHP_DW_INTERM_TB. CUSTOMER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. CUSTOMER_ID,-1))

    AND (SHP_DW_INTERM_TB. CARRIER_ID = DER_COST_PER_POUND_INTL_MONTH. CARRIER_ID)

    AND (NVL (SHP_DW_INTERM_TB. SHIPPER_ID,-1) = NVL (DER_COST_PER_POUND_INTL_MONTH. SHIPPER_ID,-1))

    AND (SHP_DW_INTERM_TB. JAVA_SESSION_ID in ('CA5AC1C5630D70B2E80E8E2A427DA249')

    AND SHP_DW_INTERM_TB. User_id in (18686)

    AND SHP_DW_INTERM_TB.IS_LTL_CARRIER (0)

    )

    GROUP OF DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M,

    DER_COST_PER_POUND_INTL_MONTH. WEIGHT,

    DER_SPEND_BY_SERV_INTL_MONTHLY. COST,

    DER_COST_PER_POUND_INTL_MONTH. SERVICE

    order DER_COST_PER_POUND_INTL_MONTH. BILL_DATE_M, DER_COST_PER_POUND_INTL_MONTH.service

    BILL_DATE_M SERVICE WEIGHT COST
    02/04/14 On the ground 121 167.73
    02/11/14 On the ground 243 181.19
    18/02/14 On the ground 729 959.85
    25/02/14 On the ground 602 356.65

    Concerning

    Etbin

  • The query results display help

    Hello

    I'm having a problem with the display of the results of my query result.

    When I cfloop on the results... the part number was released on 3 different ranks... when I want it on a single line, querying multiple tables... and you cannot use the option to group with the cfloop

    This is the query

    <cfquery datasource="wire" name="testss3">
       SELECT a.part AS pparts, a.wireid AS wireidA, a.strnds, a.wt, a.sps1, a.sps2, a.sps3, a.tin, b.slookup AS lid, b.wireid AS wireidB, b.reelid AS reelnmbr, d.reelid AS rlid, d.rname, d.rsku, d.rcost, e.plookupid, e.prctid, e.wireid AS wireidE, f.prctid, f.percentage, g.rsize
       FROM Mpart a, slookupt b, reeltbl d, prctlup e, prct f, spoolsize g
       WHERE a.wireid = b.wireid AND e.prctid = f.prctid AND a.wireid = e.wireid AND b.reelid = d.reelid AND g.spoolSizeid = b.spoolSizeid
       </cfquery>
    <table border="1" border="1">
     <tr>
            <td></td>
            <td bgcolor="#CCCCCC" class="style23">Part No.  </td>
            <td bgcolor="#CCCCCC" class="style23">Wt./Mft.</td>
            <td bgcolor="#CCCCCC" class="style23" colspan="3">Spool Sizes (Cost/ft.)</td>
            <td> </td>
          </tr>
                  
       <cfloop query="testss3"><cfoutput>
         <tr>
            <td></td>
               <td align="left" class="style23">#pparts# @</td>
                <td align="left" class="style23">#wt#</td>
               <td align="left" class="style23">
                #rsize# #rcost#  #wireidA#</cfoutput></cfloop></td>
            <td> </td>
           </tr>       
    </table>
    

    Reference No..M/m/Mft.Sizes in stock waiting (cost/pi)
    ground 10 @.31.431000 2.8000 1
    ground 10 @.31.432500 5.9800 1
    ground 10 @.31.435000 7.3000 1
    400A31.431000 2,8000 2
    400A31.432500 5,9800 2
    400A31.435000 7,3000 2
    8 ground @.50500 2,8000 4
    8 ground @.501000 5,9800 4
    8 ground @.505000 7,3000 4
    8 T @.50500 2,8000 5
    8 T @.501000 5,9800 5
    8 T @.505000 7,3000 5

    the first line should read 10 ground | 31.43. 1000 | 2500 | 5000

    rank 10 t | 31.43. 1000 | 2500 | 5000

    Any help would be appreciated!

    Thank you!

    You must nest CFOUTPUT tags to use the way you want.  One

    outside the loop to get the 'line after line only' and an inner to get all the

    subdetails in this line:

    roughly

  • How to get the Nth largest year in the query

    Hi friends,

    This is the query that I have and I want the Nth largest years wages in this table
    If this table is retruning year like 2010,2009,2008,2007 etc.

    SELECT *.
    FROM (SELECT the YEAR, MONTH, employee_number, POSITION, payroll_name, dept, status, termination_date, full_name,)
    ROW_NUMBER () OVER (PARTITION BY employee_number, basic_salary ORDER BY YEAR, MONTH) top3,
    DECODE (basic_salary,
    100000, 4500,
    24000, 1921
    basic_salary
    ) basic_salary
    OF kdd_pay_hr_sal_vw
    WHERE employee_number =: p_emp_num
    order by year desc)
    WHERE top3 < = 1
    --------------------------------------------------------

    MONTH YEAR EMPLOYEE_NUMBER POSITION STATUS FULL_NAME TOP3 BASIC_SALARY TERMINATION_DATE DEPT
    04 2010 4741 senior oracle Engineer 690-computer used JIHAD ABBAS HARB 1.00 1,600.00



    How to do it pls help

    Hello

    You must remove partition by clause basic_salary. And you must order by year and month of the desc.

    Try this,

    SELECT *
      FROM (  SELECT MONTH
                    ,YEAR
                    ,employee_number
                    ,POSITION
                    ,payroll_name
                    ,dept
                    ,status
                    ,termination_date
                    ,full_name
                    ,ROW_NUMBER ()
                        OVER (PARTITION BY employee_number ORDER BY YEAR DESC, MONTH DESC)
                        top3
                    ,DECODE (basic_salary,  100000, 4500,  24000, 1921,  basic_salary)
                        basic_salary
                FROM kdd_pay_hr_sal_vw
               WHERE employee_number = :p_emp_num
            ORDER BY YEAR DESC)
     WHERE top3 = 1
    

    G.

  • When, on my home page, I click on the link "transparent popup" in the query "did you mean: transparent popup", NO RESULTS appear in this new tab; How to solve?

    I had trouble due, apparently, to a file named popuptransparent [dot] xul, which I have 3 cases on my computer (Win XP/Firefox last v.). Using my window of AVG home page, I get "popuptransparent" (try to fix) and the results appear OK. But then when I click to a new tab, on the "transparent popup" link in the query "did you mean: transparent popup", NO RESULTS appear in this new tab. In addition, when I reload then the Panel of AVG which sought to 'popuptransparent' in the first place, it, too, shows now no results. Or a panel shows Google now no results. They show the quantity of results, but just white screens for the results themselves.

    Links https://support.mozilla.org/en-US/questions/948804?esab=a & as = aaq and https://support.mozilla.org/en-US/questions/952141?esab=a & as = aaq brings me. I re-installed Firefox v. 20.0.1 nothing works. How to fix?

    Should I remove it from my computer all 3 of these instances of xul [dot]?

    Regarding the problem of searching, you can check the extension "Disconnect"? I think it could affect the Google sites and third parties who use Google. You can disable or try its button Options here:

    Firefox orange (or the Tools menu) button > addons > Extensions category

    While you're there, you can disable all extensions essential and unrecognized. When in doubt, turn off.

    After restarting Firefox, did you notice a difference?

    Could you explain in more detail the next part?

    Should I remove it from my computer all 3 of these instances of xul [dot]?

    Is this something that came in a security sweep? What question do you think they are originally? They are located in a folder extensions?

  • Bezier Motion 5.0.7 masks appear in the timeline panel, but in the column of layers only. This started happening yesterday. The query projects previously do not have this problem. I can't change if masks appear in the timeline panel.

    Motion 5.0.7 memory 8 GB, processor 2.93 GHz intel Core i7, ATI Radeon HD 5750 1024 MB graphics

    Bezier masks do not appear in the timeline, preventing me from editing. The masks appear in the column of layers only. The problem just started yesterday. The query projects previously do not seem to be performed.

    In the upper right corner of the canvas, there is a view menu. Check if the 'lines' are checked in the section view overlays.

  • bad design but the query needed to solve this problem

    Dear expert;

    I have the sample data below
    create table p1_header
    (
           parent_id number(30),
           p_shutterid number(30),
           color varchar2(4000)
    );
    
    
    insert into p1_header
      (parent_id, p_shutterid, color)
    values
      (1111, 789, 'GREY');
      
    insert into p1_header
      (parent_id, p_shutterid, color)
    values
      (444, 456, 'RED');
      
    insert into p1_header
      (parent_id, p_shutterid, color)
    values
      (999, 123, 'WHITE');
    
    insert into p1_header
      (parent_id, p_shutterid, color)
    values
      (888, 900000, 'BLACK');
    create table p1 
    ( p1_id number(30),
      p_shutterid number(30),
      parent_id number(30),
      describe_me varchar2(1000)
    );
    
    
     insert into p1
      (p1_id, p_shutterid, parent_id, describe_me)
    values
      (5, 131415, 999, 'ZONE LAKE');
      
    insert into p1
      (p1_id, p_shutterid, parent_id, describe_me)
    values
      (6, 161718, 999, 'ZONE BOSTON');
      
    insert into p1
      (p1_id, p_shutterid, parent_id, describe_me)
    values
      (7, 192021, 999, 'ZONE NY'); 
    insert into p1
      (p1_id, p_shutterid, parent_id, describe_me)
    values
      (1, 123, 888, 'ZONE PLACE');
    insert into p1
      (p1_id, p_shutterid, parent_id, describe_me)
    values
       (2, 456, 888, 'BIG AGE'); 
    insert into p1
       (p1_id, p_shutterid, parent_id, describe_me)
    values
       (3, 789, 888, 'EMG');  
    insert into p1
       (p1_id, p_shutterid, parent_id, describe_me)
    values
       (4, 101112, 888, 'SMC');  
    
    insert into p1
       (p1_id, p_shutterid, parent_id, describe_me)
    values
       (8, 97080402, 444, 'CLASH');  
       
       insert into p1
       (p1_id, p_shutterid, parent_id, describe_me)
    values
       (9, 4687903, 444, 'INTEREST');  
       
    This is the output I want below for parent_id 888
    P_SHUTTERID   DESCRIBE_ME
    123                  ZONE PLACE 
    456                  BIG AGE 
    789                 EMG
    101112            SMC     
    192021            ZONE NY
    131415            ZONE LAKE
    161718            ZONE BOSTON
    4687903          INTEREST
    97080402        CLASH
    the idea behind the logic is when user id input parent 888, then we get a list of all kinds of things.

    Thus, for example the first list shows all the children (p_shutterid) associated to 888 parent id and then we go to every child (p_shutterid) individual and get any associated child and do this at the end and once that the first child is done we are going to the next child (p_shutterid), which is of 456 and get all children for that child. This is how the output is derived.

    Any help is appreciated. Thank you.

    Published by: user13328581 on July 15, 2011 07:32

    Published by: user13328581 on July 15, 2011 10:35

    Published by: user13328581 on July 15, 2011 10:36

    Hello.

    Yes, it is an example.

    SELECT LEVEL,p1.p_shutterid,p1.describe_me
    FROM p1_header,p1
    WHERE p1.parent_id=p1_header.parent_id
    START WITH p1.parent_id=888
    CONNECT BY p1_header.p_shutterid = PRIOR p1.p_shutterid;
    
    LEVEL     P_SHUTTERID     DESCRIBE_ME
    -----     ----------     ----------
    1     123          ZONE PLACE
    2     131415          ZONE LAKE
    2     161718          ZONE BOSTON
    2     192021          ZONE NY
    1     456          BIG AGE
    2     4687903          INTEREST
    2     97080402     CLASH
    1     789          EMG
    1     101112          SMC
    

    An important note:

    >
    A general reminder on "Forum label / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718

    It is important to score the answers you thought useful or appropriate, he lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching on the same issue, moreover, this means that when you mark a bad or wrong the useful answer someone can be invited to tell you (and the rest of the forum) which is bad or wrong on the answer you have found useful.
    >

    Kind regards.

  • ID of the query for HP8562A Spectrum Analyzer

    Hello

    I'm just having some difficulty in communicating with my the HP8562A Spectrum Analyzer. I tried to send the query "* IDN?" but he cannot read (probably due to the age of the parser). I look around the Query Analyzer can understand but have had no luck so far. If anyone has had experience with this instrument and communicate with him using GPIB, any help would be greatly appreciated.

    See you soon.

    Try again with ' ID? (no * and no N)

  • Error message when I run delete the query in SQL Server 2008.

    Error message when I run delete the query in SQL Server 2008 SP3.

    Error message:

    MSG 0, level 11, State 0, line 0
    A serious error occurred on the current command.  The results, if any, should be discarded.

    I never got any problem since 5 years.

    Please let me know what is the cause of the problem.

    You can get a response better/faster if repost you your question in the instances of SQL Server dedicated from Microsoft here:

    http://social.technet.microsoft.com/Forums/en-us/category/sqlserver .

    Thank you.   :)

    (I'm sorry, but I can't move this thread for you because the two forums are working on separate platforms)

  • Unable to load the query in Crystal Designer: error "Could not load the Query builder compenent."

    Hi all
    I am using Crystal report 10 which was an upgrade of crystal 7 and 8.5
    I can open the crystal report and can do everything but I could not display the SQL query option
    It gives me an error message
    "Failed to load the Query builder compenent."
    I also reinstalled the application twice as a sysadmin even then I get this message
    Please, can someone suggest me what should I do?

    Contact technical support for Crystal Reports or watch in their forums. This is not a product of MS and is not related to the installation, upgrade and activation of Windows XP.

  • Select the query in the sqlite database

    Hello friends,

    I used this application in my application... It worked fine...

    Select fld_name in the limit of 0.10 tbl_placelist

    But when I used the query below, he showed me error...

    «Select fld_name in the limit of tbl_placelist «+ s1, 10»»

    I do not have how to pass two values (i.e) a global variable and an integer in the limit

    Can someone help me...

    Maybe I'm missing something but you want to say something like this:

    S1 int = 0;

    int s2 = 10;

    String q = 'select fld_name from tbl_placelist limit' + s1 + ', ' + 's2;


  • Window of the query editor with Microsoft SQL Server Management Studio DO NOT scroll

    In my view, that it is a question more of a Microsoft SQL Server Management Studio number... apologies if you think I might be in the wrong place of Windows...

    When you work in Microsoft SQL Server Management Studio, my cursor is common in my part of the query editor window. When I try using my scroll wheel it to review some SQL code, instead the scroll on my mouse wheel is controlling the pane objects in the Solution Explorer window and NOT the glass query editor.
    Some of our partners appear to be well with their ability to scroll using the mouse scroll wheel while others seem to be in the same boat I am, and nobody here seems to know why it is.
    I hope for some comments and I am hopeful for an answer. Thanks in advance.
    PSULionRP

    Hello

    The question you posted would be better suited to the TechNet community. Please visit the link below to find a community that will provide the support you want.

    http://social.technet.Microsoft.com/forums/Gu-in/sqldatawarehousing/threads

    Hope this information helps.

Maybe you are looking for

  • I background clock os10

    I have an iPhone 6s and I've updated yesterday at I OS10 - now, my clock background is dark with light lettering - I need so he can return to bottom clear with black lettering - I know this may seem small, but the darker background white inscription

  • Pavilion tx 1000: lost BIOS password

    Lock code 09027 - please help me rest.

  • My Hotspot device

    I have a Mac Mini to the OS10.8.5 not Intel; I think that I am unable to go further with my operating system. Last year, I went down dialup using a WiMax router with an Ethernet cable (from freedom Pop). Then in November 2015, Freep said "WiMax gone

  • Running a LabVIEW application on a MAC without LabVIEW yosemite

    Hi all! When you compile the code LabVIEW on a Mac, you create a ".app" instead of a ".exe". I would like to run my ".app" to another Mac running with Yosemite (OSX 10.10) NI LabVIEW on it. I downloaded the latest RunTime for LabVIEW on the Mac engin

  • How can I remove malware that redirects to another site search results for example find fast answers?

    Whenever I use the search engines Google or Bing for a topic and receive the results, whenever I try to click on the link in the results, my research turned away on gimme responses or answers or some other search engine site instead of take me to the