Help with Plsql

I have a table which has employee_id, win_date, department
I need to find all employees within departments '1A', '3B' , '2A' , '2C' with their individual highest win_date and their win_date < '29-oct-2010'
If an employee has their max dates same for 2 different departments I need to pick the order as listed above. For eg. if emp_id 2 has '10/28/2010' for 3B and '10/28/2010' for 2C I would need to list 3B and not 2C.
Create table temp_emp
emp_id varchar2(5 byte),
win_date date,
department varchar2(2 byte)
insert into temp_emp
values('1','15-oct-2010', '2B');
insert into temp_emp
values('1','10-oct-2010', '3B');
insert into temp_emp
values('2','28-oct-2010', '3B');
insert into temp_emp
values('2','28-oct-2010', '2C');
insert into temp_emp
values('2','15-oct-2010', '1A');
insert into temp_emp
values('2','15-JUL-2010', '2B');
insert into temp_emp
values('3','16-oct-2010', '1A');
insert into temp_emp
values('3','19-oct-2010', '2C');
insert into temp_emp
values('4','15-JUN-2010', '2A');
insert into temp_emp
values('4','15-JUN-2010', '2B');
insert into temp_emp
values('4','12-oct-2010', '2C');
The final result should be
'1' '10-oct-2010' '3B'
'2' '28-oct-2010' '3B'
'3' '19-oct-2010' '2C'
'4' '12-oct-2010' '2C'
Thanks

with temp_emp as
select '1' emp_id,to_date('15-10-2010','DD-MM-YYYY') win_date, '2B' department from dual union all
select '1',to_date('10-10-2010','DD-MM-YYYY'), '3B' from dual union all
select '2',to_date('28-10-2010','DD-MM-YYYY'), '3B' from dual union all
select '2',to_date('28-10-2010','DD-MM-YYYY'), '2C' from dual union all
select '2',to_date('15-10-2010','DD-MM-YYYY'), '1A' from dual union all
select '2',to_date('15-07-2010','DD-MM-YYYY'), '2B' from dual union all
select '3',to_date('16-10-2010','DD-MM-YYYY'), '1A' from dual union all
select '3',to_date('19-10-2010','DD-MM-YYYY'), '2C' from dual union all
select '4',to_date('15-06-2010','DD-MM-YYYY'), '2A' from dual union all
select '4',to_date('15-06-2010','DD-MM-YYYY'), '2B' from dual union all
select '4',to_date('12-10-2010','DD-MM-YYYY'), '2C' from dual
select emp_id
      ,max(win_date) keep (dense_rank last order by decode(department,'1A',4,'3B',3,'2A',2,'2C',1,0) asc , win_date asc ) win_date
      ,max(department) keep (dense_rank last order by decode(department,'1A',4,'3B',3,'2A',2,'2C',1,0) asc ) department     
from temp_emp
group by emp_id;You would retrieve the same result with:
select emp_id
      ,max(win_date) keep (dense_rank last order by decode(department,'1A',1,'3B',2,'2A',3,'2C',4,5) desc , win_date asc ) win_date
      ,max(department) keep (dense_rank last order by decode(department,'1A',1,'3B',2,'2A',3,'2C',4,5) desc ) department     
from temp_emp
group by emp_id;I come to a different result for employees 2,3 and 4, because 1A comes before 3B and 2A comes before 2C in your list:
result:
1     10.10.10     3B
2     15.10.10     1A
3     16.10.10     1A
4     15.06.10     2AEdited by: hm on 11.11.2010 06:42

Similar Messages

  • Help with PLSQL table population.....

    Hi all,
    I am populating a PLSQL table from a cursor and then inserting into a target table using FORALL.
    While populating, I need two two records differing only by the process_name.
    Say my populated PLSQL table should look like this.
    vt_proc_status_tbl:
    1     76     Pname_A     20     Sysdate     1     U     1
    1     76     Pname_B     20     Sysdate     1     U     1
    How can I create duplicate records like this inside the PLSQL table varying only by process_name????
    OPEN cur_fcst_sites_ppo;
    FETCH cur_fcst_sites_ppo
    BULK COLLECT INTO vt_fcst_sites_tbl;
    CLOSE cur_fcst_sites_ppo;
    FOR v_idx_fcst_sites IN 1 .. vt_fcst_sites_tbl.COUNT
    LOOP
    BEGIN
    SELECT seq_ods_site_process_status.NEXTVAL
    INTO v_odssiteprocessid
    FROM DUAL;
    END;
    v_pst_idx := v_pst_idx + 1;
    vt_proc_status_tbl (v_pst_idx).odssiteprocessid :=
    v_odssiteprocessid;
    vt_proc_status_tbl (v_pst_idx).SYSTEM := pi_system;
    vt_proc_status_tbl (v_pst_idx).process_name := pi_process_name;
    vt_proc_status_tbl (v_pst_idx).siteid :=
    vt_fcst_sites_tbl (v_idx_fcst_sites).siteid;
    vt_proc_status_tbl (v_pst_idx).bday := pi_transferday;
    vt_proc_status_tbl (v_pst_idx).is_no := pi_is_no;
    vt_proc_status_tbl (v_pst_idx).rest_status := c_status_unprocessed;
    vt_proc_status_tbl (v_pst_idx).batch_id := v_batch_id;
    v_cntr := v_cntr + 1;
    IF v_cntr = pi_sites_at_a_time
    THEN
    v_batch_id := v_batch_id + 1;
    v_cntr := 0;
    END IF;
    v_odssiteprocessid := NULL;
    END LOOP;
    IF v_pst_idx &gt; 0
    THEN
    BEGIN
    FORALL v_proc_status_tbl_idx IN 1 .. vt_proc_status_tbl.COUNT
    INSERT INTO ods_site_process_status
    VALUES vt_proc_status_tbl (v_proc_status_tbl_idx);
    END;
    ELSE
    v_code := NULL;
    SELECT SUBSTR ( '[M]:0- No Site Available for the '
    || pi_process_name
    || ' Process For '
    || DECODE (pi_process_name,
    c_transform_bmi_ppo, 'IS_NO '
    || pi_is_no,
    'TransferDay ' || pi_transferday
    || '..',
    1,
    125
    INTO v_errm
    FROM DUAL;
    DBMS_OUTPUT.put_line (v_errm);
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform_master',
    v_errm,
    vr_market.marketid,
    'I'
    END IF;
    Thanks in Advance.
    Jagadish
    Edited by: user646716 on Oct 12, 2008 10:08 AM
    Edited by: user646716 on Oct 12, 2008 12:02 PM

    hi aweiden,
    Please find my entire code below.
    what I am trying to achieve is that when my plsql table vt_proc_status_tbl is populated, I want two different rows to be populated for different process names (i.e bmi_ppo and bmi_ai ) and load it into ODS_SITE_PROCESS_STATUS table so that i do not have to alter my forall statement.
    Thanks for the help
    PROCEDURE p_mfcst_transform_master (
    pi_system IN mfcst_ppo.SYSTEM%TYPE,
    pi_is_ no IN mfcst_ppo.is_no%TYPE,
    pi_transferday IN mfcst_ppo.transferday%TYPE,
    pi_sites_at_a_time IN NUMBER,
    pi_process_name IN ods_site_process_status.process_name%TYPE,
    po_status OUT NUMBER,
    po_error OUT VARCHAR2
    AS
    -- Cursor to get sites to be processed for bmi to ppo transformation process
    CURSOR cur_fcst_sites_ppo
    IS
    SELECT DISTINCT siteid
    FROM sci_restaurant
    WHERE hist_load_status in ('L','H')
    AND SYSTEM = pi_system
    ORDER BY siteid;
    -- Cursor to get sites to be processed for bmi to ai transformation process
    -- Note this cursor is based on the system and transfer day
    TYPE sites_tbltype IS TABLE OF cur_fcst_sites_ppo%ROWTYPE
    INDEX BY PLS_INTEGER;
    vt_fcst_sites_tbl sites_tbltype;
    TYPE proc_status_tbltype IS TABLE OF ods_site_process_status%ROWTYPE
    INDEX BY PLS_INTEGER;
    vt_proc_status_tbl proc_status_tbltype;
    v_cnt NUMBER := 0;
    v_cntr NUMBER := 0;
    v_batch_id NUMBER := 1;
    v_pst_idx PLS_INTEGER := 0;
    v_k PLS_INTEGER := 0;
    v_odssiteprocessid ods_site_process_status.odssiteprocessid%TYPE;
    v_exceptionid NUMBER;
    --variable to log exception into sci_exception table
    BEGIN
    --- If sites were identitfied before, skip the rest of the execution
    --- Note that ods_site_process_status holds the status from the prior runs
    po_error := '';
    po_status := 0;
    scimf_common.p_get_market_parameters (NULL,
    pi_system,
    vr_market,
    v_error_out
    IF v_error_out IS NOT NULL
    THEN
    RAISE e_market_not_found;
    END IF;
    IF pi_process_name = c_transform_bmi_ppo
    THEN
    SELECT COUNT (*)
    INTO v_cnt
    FROM ods_site_process_status
    WHERE SYSTEM = pi_system
    AND process_name = pi_process_name
    AND is_no = pi_is_no
    AND ROWNUM < 2;
    ELSIF pi_process_name = c_transform_bmi_ai
    THEN
    SELECT COUNT (*)
    INTO v_cnt
    FROM ods_site_process_status
    WHERE SYSTEM = pi_system
    AND process_name = pi_process_name
    AND rest_status = c_status_processed
    AND ROWNUM < 2;
    ELSE
    v_code := NULL;
    v_errm :=
    SUBSTR ( '[E]:0- Process Name :>'
    || pi_process_name
    || '<Is Not Proper For System:>'
    || pi_system
    || '< and IS_NO :>'
    || pi_is_no
    || '< and TransferDay :>'
    || pi_transferday
    || '<',
    1,
    125
    DBMS_OUTPUT.put_line (v_errm);
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform',
    v_errm,
    vr_market.marketid,
    'I'
    po_error := TO_CHAR (SQLCODE) || ' -Error Message: ' || v_errm;
    po_status := -1;
    -- Log Exception in the log file and come out.
    END IF;
    IF NVL (v_cnt, 0) > 0
    THEN
    IF pi_process_name = c_transform_bmi_ppo
    THEN
    SELECT SUBSTR
    ( ':0- Sites are already identified before for the '
    || pi_process_name
    || ' Process For '
    || DECODE (pi_process_name,
    c_transform_bmi_ppo, 'IS_NO ' || pi_is_no,
    'TransferDay ' || pi_transferday
    || '..'
    || 'proceeding to invoke child scripts',
    1,
    125
    INTO v_errm
    FROM DUAL;
    DBMS_OUTPUT.put_line (v_errm);
    ELSIF pi_process_name = c_transform_bmi_ai
    THEN
    SELECT SUBSTR
    ( '[I]:0- Sites are already identified before for the '
    || pi_process_name
    || ' Process For '
    || DECODE (pi_process_name,
    c_transform_bmi_ai, 'IS_NO ' || pi_is_no,
    'TransferDay ' || pi_transferday
    || '..'
    || 'proceeding to invoke child scripts',
    1,
    125
    INTO v_errm
    FROM DUAL;
    DBMS_OUTPUT.put_line (v_errm);
    END IF;
    ELSIF NVL (v_cnt, 0) = 0
    THEN
    OPEN cur_fcst_sites_ppo;
    FETCH cur_fcst_sites_ppo
    BULK COLLECT INTO vt_fcst_sites_tbl;
    CLOSE cur_fcst_sites_ppo;
    END IF;
    -- Logic to batch the sites to be processed in the batches of
    -- sites derived from the pi_sites_at_a_time parameter
    -- Batch_Id starts with 1 and need to used along with
    -- either is_no (bmi-ppo) and process name or along with
    -- system, bday and process_name (bmi-ai)
    IF pi_sites_at_a_time IS NULL
    THEN
    v_code := NULL;
    v_errm := 'Site At A Time not defined';
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform_master',
    v_errm,
    vr_market.marketid,
    'I'
    po_error := TO_CHAR (SQLCODE) || ' -Error Message: ' || v_errm;
    po_status := -1;
    raise_application_error (-200002, v_errm);
    END IF;
    FOR v_idx_fcst_sites IN 1 .. vt_fcst_sites_tbl.COUNT
    LOOP
    BEGIN
    SELECT seq_ods_site_process_status.NEXTVAL
    INTO v_odssiteprocessid
    FROM DUAL;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    DBMS_OUTPUT.put_line ( '[E]:0- Sequence :>'
    || 'seq_ods_site_process_status'
    || ' <Is Invalid>'
    || '<'
    v_errm :=
    SUBSTR ( 'Sequence seq_ods_site_process_status Error:'
    || SQLERRM,
    1,
    125
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform',
    v_errm,
    vr_market.marketid,
    'I'
    po_error :=
    TO_CHAR (SQLCODE) || ' -Error Message: '
    || v_errm;
    po_status := -1;
    raise_application_error (-200002, v_errm);
    END;
    v_pst_idx := v_pst_idx + 1;
    vt_proc_status_tbl (v_pst_idx).odssiteprocessid :=
    v_odssiteprocessid;
    vt_proc_status_tbl (v_pst_idx).SYSTEM := pi_system;
    vt_proc_status_tbl (v_pst_idx).process_name := pi_process_name;
    vt_proc_status_tbl (v_pst_idx).siteid :=
    vt_fcst_sites_tbl (v_idx_fcst_sites).siteid;
    vt_proc_status_tbl (v_pst_idx).bday := pi_transferday;
    vt_proc_status_tbl (v_pst_idx).is_no := pi_is_no;
    vt_proc_status_tbl (v_pst_idx).rest_status := c_status_unprocessed;
    vt_proc_status_tbl (v_pst_idx).batch_id := v_batch_id;
    v_cntr := v_cntr + 1;
    IF v_cntr = pi_sites_at_a_time
    THEN
    v_batch_id := v_batch_id + 1;
    v_cntr := 0;
    END IF;
    v_odssiteprocessid := NULL;
    END LOOP;
    IF v_pst_idx > 0
    THEN
    BEGIN
    FORALL v_proc_status_tbl_idx IN 1 .. vt_proc_status_tbl.COUNT
    INSERT INTO ods_site_process_status
    VALUES vt_proc_status_tbl (v_proc_status_tbl_idx);
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    v_error_count := SQL%BULK_EXCEPTIONS.COUNT;
    DBMS_OUTPUT.put_line
    ( '[E]:0- Bulk Insert Fail using FORALL Number of Failure:>'
    || v_error_count
    || '<'
    FOR v_i IN 1 .. v_error_count
    LOOP
    v_errm :=
    SUBSTR
    ( '[E]:Error Insert into ODS_SITE_PROCESS_STATUS table '
    || 'Insert Error: '
    || v_i
    || ' Array Index: '
    || SQL%BULK_EXCEPTIONS (v_i).ERROR_INDEX
    || SQLERRM
    (-SQL%BULK_EXCEPTIONS (v_i).ERROR_CODE),
    1,
    125
    DBMS_OUTPUT.put_line (v_errm);
    END LOOP;
    v_code := NULL;
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform_master',
    v_errm,
    vr_market.marketid,
    'I'
    po_error :=
    TO_CHAR (SQLCODE) || ' -Error Message: '
    || v_errm;
    po_status := -1;
    END;
    ELSE
    v_code := NULL;
    SELECT SUBSTR ( '[M]:0- No Site Available for the '
    || pi_process_name
    || ' Process For '
    || DECODE (pi_process_name,
    c_transform_bmi_ppo, 'IS_NO '
    || pi_is_no,
    'TransferDay ' || pi_transferday
    || '..',
    1,
    125
    INTO v_errm
    FROM DUAL;
    DBMS_OUTPUT.put_line (v_errm);
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform_master',
    v_errm,
    vr_market.marketid,
    'I'
    END IF;
    END IF;
    COMMIT;
    po_status := NVL (po_status, 0);
    EXCEPTION
    WHEN e_market_not_found
    THEN
    ROLLBACK;
    v_code := NULL;
    v_errm := SUBSTR ('[E]:Error Market Not Found ' || SQLERRM, 1, 125);
    scimf_common.write_log (v_code, --Log error into the LOGFILE
    'E',
    'p_mfcst_transform_master',
    v_errm,
    vr_market.marketid,
    'I'
    raise_application_error (-200001,
    'Market parameter not found for system'
    || pi_system
    po_error := TO_CHAR (SQLCODE) || ' -Error Message: ' || SQLERRM;
    po_status := -1;
    WHEN OTHERS
    THEN
    ROLLBACK;
    DBMS_OUTPUT.put_line ( '[E]:0-ERROR :-- '
    || ' --SQLCODE: '
    || SQLCODE
    || ' -Error Message: '
    || SQLERRM
    po_error := TO_CHAR (SQLCODE) || ' -Error Message: ' || SQLERRM;
    po_status := -1;
    END;

  • Ugent: I need help with plsql:

    Some body helps me to do the following updated using plsql:
    I have two tables, xx_firm and xx_contact, related by “firm_seq”; one to many.
    The xx.contact has the following fields:
    cntc_firm_seq
    cntc_title_desc
    cntc_aap_contact
    were firm_seq (from xx_firm) is equal to cntc_firm_seq. Meaning that a firm can have one or many contacts, but one of this contacts must be storage the value “765”.
    I need able to update the field “cntc_title_desc” to 765 only if not of its contacts have that value.
    Thanks,

    there is an error in my sql and hope you may be able to spot it:
    update xx_contact c
    set cntc_title_desc='756'
    where cntc_firm_seq =(select f.firm_seq --was c.firm_seq
    from xx_firm f
    where f.firm_seq = c.cntc_firm_seq
    and c.cntc_title_desc <> '765';

  • Help with Plsql Procedure

    This is my thread in this forum, so please let me know if I am not so specific in my request.
    I have an existing table (say Table AAA having columns A1, A2, A3) and I have created a view on this table (say AAA_VW). I have also added 3 more rows in the AAA_VW (say 11,22,33).
    I have to load the data from the view to a new table (say Table BBB having the same table structure as Table AAA).
    I need to insert the data to table BBB from AAA_VW along with the 3 new rows that are added in the view.
    Now, any time the table AAA has new rows inserted or if the existing rows are updated, then I need to insert or update the data in table BBB thru view.
    Which means that when new rows are inserted or if rows are updated in table AAA, then the view will also show the same data (as it will point to table AAA). I will have to insert the new rows or update the rows accordingly in table BBB thru view.
    The table should NOT be empty at any point of time.
    I would appreciate if anyone could show me a ways how to proceed, or maybe show me some examples similar to what I m trying to achive.
    Thanks in advance

    What you need is to create a process that can complete the process for you without your intervention.
    Option 1 - Since you have already started using the view, then simply schedule a job that will select the record from AAA_VW and update the record in BBB. The procedure should check that if the record already exists (using some ID), then it will update it. Else, it should insert it.
    Option 2 - If you can review and change your method, you can achieve this with a Trigger created on AAA table to update BBB AFTER INSERT OR UPDATE.
    Option 3 - Depending on the use of BBB, you can eliminate the middle AAA_VW. Create BBB as a Materialized View with fast refresh ON COMMIT. Then create a related Materialized View Log on AAA.

  • Please help with PLSQL loop programing to join 2 tables

    The following two tables are created in Oracle 10g. Oracle is forced to merge these
    two tables (over column A). Write a PL/SQL block of code that performs this task.
    A C ||||||||||||||| A D
    2 c1 ||||||||||||||| 2 d2
    8 c1 ||||||||||||||| 8 d3
    6 c2 ||||||||||||||| 6 d4
    10 c34 |||||||||||| 4 d6
    1 c4 ||||||||||||||| 2 d7
    7 c4
    4 c5
    5 c6
    2 c7
    Requires a nested loop join in PL/SQL.
    Message was edited by:
    user635545

    Is there actually a question here or do you just want someone to write it for you?

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • I need help with Sunbird Calendar, how can I transfer it from one computer to the other and to my iphone?

    I installed Sunbird in one computer and my calendar has all my infos, events, and task that i would like to see on another computer that i just downloaded Sunbird into. Also, is it possible I can access Sunbird on my iphone?
    Thank you in advance,

    Try the forum here - http://forums.mozillazine.org/viewforum.php?f=46 - for help with Sunbird, this forum is for Firefox support.

  • Hoping for some help with a very frustrating issue!   I have been syncing my iPhone 5s and Outlook 2007 calendar and contacts with iCloud on my PC running Vista. All was well until the events I entered on the phone were showing up in Outlook, but not

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

  • Help with HP Laser Printer 1200se

    HP Support Line,
    Really need your assistance.  I have tried both contacting HP by phone (told they no longer support our printer via phone help), the tech told me that I needed to contact HP by e-mail for assistance.   I then sent an e-mail for assistance and got that reply today, the reply is as follows  "Randall, unfortunately, HP does not offer support via e-mail for your product.  However many resources are available on the HP web site that may provide the answer to your inquiry.  Support is also available via telephone.  A list of technical support numbers can be round at the following URL........."  The phone numbers listed are the ones I called and the ones that told me I needed to contact the e-mail support for help.
    So here I am looking for your help with my issue.
    We just bought a new HP Pavillion Slimline Desk Top PC (as our 6 year old HP Pavillion PC died on us).  We have 2 HP printers, one (an all-in-one type printer, used maily for copying and printing color, when needed) is connected and it is working fine with the exception of the scanning option (not supported by Windows 7).  However we use our Laser Printer for all of our regular prining needs.  This is the HP LaserPrinter 1200se, which is about 6 years old but works really well.  For this printer we currently only have a parallel connection type cord and there is not a parallel port on the Slimline HP PC.  The printer also has the option to connedt a USB cable (we do not currently have this type of cable).
    We posed the following two questions:
    1.  Is the Laser Jet 1200se compatible with Windows 7?
    and if this is the case
    2.  Can we purchase either a) a USC connection cord (generic or do we need a printer specific cord)? or b) is there there a printer cable converter adapater to attach to our parallel cable to convert to a USB connection?
    We do not want to purchase the USB cable if Windows 7 will not accept the connection, or if doing this will harm the PC.
    We really would appreciate any assitance that you might give us.
    Thank you,
    Randy and Leslie Gibson

    Sorry, both cannot be enabled by design.  That said, devices on a network do not care how others are connected.  You can print from a wireless connection to a wired (Ethernet) printer and v/v.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Going to Australia and need help with Power converters

    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  

    godzillafan868 wrote:
    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  
    Check the specs on input voltage/frequency of your power supplies.
    Many laptop power supplies are "universal/global" and are specced something like 80-265 volts AC 50/60 Hz, but not all.  These will just need a connector adapter.
    Unsure about the PS3 Slim - if it isn't universal it could be difficult as you'll need a 110/220 transformer, one big enough (power-handling wise) for the PS3 will be very bulky.
    For the external WD HDD, if it doesn't have a universal supply, you're probably best off just finding a new wallwart for it that is capable of running on 220/50.
    *disclaimer* I am not now, nor have I ever been, an employee of Best Buy, Geek Squad, nor of any of their affiliate, parent, or subsidiary companies.

  • Creation of context sensitive help with pure FM 12 usage doesn't work

    Hi,
    I hope somebody is able to help me with a good hint or tip.
    I am trying to create a context-sensitive Microsoft Help with FM12 only using the abilities of FM (no RoboHelp). For some reasons, my assigned ID's are not used in the generated chm file and therefore the help does not work context-sensitively.
    What did I do?
    - I created my FM files and assigned topic aliases to the headers. I did this two ways: a) using the "Special" menue and assigning a CSH marker and/or b) setting a new marker of type "Topic Alias" and typing the ID. I used only numeric IDs like "2000" or "4200",
    - I created a .h file (projectname.h) - based on the format of the file projectname_!Generated!.h (I read this in some instructions). So the .h file (text file) looks like this:
    #define 2000 2000 /* 4 Anwendungsoberfläche */
    #define 2022 2022 /* 4.1.1 Menü Datei */
    #define 2030 2030 /* 4.1.3 Menü Parametersatz */
    #define 2180 2180 /* 6.6.7 Objektdialog Q-Regler */
    #define 2354 2354 /* 6.9.2 Objektdialog Extran Parameter */
    #define 2560 2560 /* 6.9.5 Objektdialog Extran2D Parametersatz */
    - I published the Microsoft HTML Help. A projectname_!Generated!.h has been created. My IDs were not used in this file:
    #define 2000    1
    #define 2022    2
    #define 2030    3
    #define 2180    4
    #define 2354    5
    #define 2560    6
    - When I open the .chm file and look in the source code, the ID even is totally different. It is not the one, I assigned in FM, it is not the one which I assigned in the projectname.h file and it even is not the one, which was put in the projectname_!Generated!.h file. It is a generated name starting with CSH_1 ...n in a consecutive way numbered.
    Example:
    <p class="FM_Heading1"><a name="XREF_72066_13_Glossar"></a>Gloss<a name="CSH_1"></a>ar</p>
    What goes wrong? Why does FM not take my assigned IDs? I need to use these IDs since our programmers are using those already - I had to re-create the whole online help but the programs stay untouched.
    Please help!
    Many thanks
    Mohi

    Hi Jeff,
    thanks for your note!
    The text in my marker is just a number like "2000" or "4200". As said, I created manually a my.h file and used this marker there. E.g.
    #define 2000 2000.
    Whereby the first 2000 (in my opinion) is the marker text and the second 2000 is the context ID which the programmers are using for the context sensitive call of the help. My definitions in the my.h file were translated to #define 2000 1 (in the my_!Generated!.h file). The source code "translates" the context ID into CSH_8.
    I am still confused :-/
    Thanks
    Mohi

  • Need help with Boot Camp and Win 7

    I have iMac 27" (iMac11,1) 2.8 GHz, quad core, 8MB of L3, 8GB of Memory, Boot ROM Version IM111.0034.B02 and SMC Version 1.54f36 and can't get this machine to run Windows 7 using Boot Camp.  I have successfully loaded Win 7 but when it claims to be starting I only get a black screen after initial start up.
    I have checked and rechecked my software updates and have read and reread the instructions, however, I can't update my Boot Camp to 3.1 (my machine says i'm running 3.0.4) and I need 3.1 but can't load 3.1 because it is an exe file that has to be loaded into Windows after I load Windows but can't open Windows because I can't load Boot Camp 3.1.  That's my excuse anyway, so I'm missing something I just can't figure out what it is....this is where you come in!
    Thanks.
    Mike

    Mike,
    I'm not going to be much help with Boot Camp however I can direct you to the Boot Camp forum where there are more people that know how to troubleshoot it and Windoze 7. You can find it at:
    https://discussions.apple.com/community/windows_software/boot_camp
    Roger

  • Can some help with CR2 files ,Ican`t see CR2 files in adobe bridge

    can some help with CR2 files ,I can`t see CR2 files in adobe bridge when I open Adobe Photoshop cs5- help- about plugins- no camera raw plugins. When i go Edit- preference and click on camera raw  shows message that Adobe camera raw plugin cannot be found

    That's strage. Seems that the Camera Raw.8bi file has been moved to different location or has gone corrupt. By any chance did you try to move the camera raw plugin to a custom location?
    Go To "C:\Program Files (x86)\Common Files\Adobe\Plug-Ins\CS5\File Formats" and look for Camera Raw.8bi file.
    If you have that file there, try to download the updated camera raw plugin from the below location.
    http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5371&fileID=5001
    In case  you ae not able to locate the Camera Raw.8bi file on the above location, then i think you need to re-install PS CS5.
    [Moving the discussion to Photoshop General Discussions Forum]

  • Be grateful for your help with Photoshop Elements which I have been using for several years.

    Be grateful for your help with Photoshop Elements which I have been using for several years.  Does Elements need to have access to ‘My Pictures’ on Windows as when I remove Photos from ‘My Pictures’, Elements later, when backing up, gives a message that it is unable to ‘reconnect’ to the same picture on elements.  On other occasions when removing a photo from Elements catalogue I also get a similar message when backing up saying ‘unable to reconnect’.  1. Is there a relationship between Elements and My Pictures and is Elements dependant on    the Windows ‘My Pictures’? 2. Why does some photos in Elements in some cases cause them to multiply e.g. double; triple; quadruple; and on occasions even more?  Is there something I need to do to stop this or an easy way I can remove the multiples without spending hours doing it manually one by one?  Am I doing something wrong? My O/S is Windows XP SP2 and windows Vista on my Laptop.  I have been using Elements 5 and have just purchased Photoshop Elements 8.0. (Upgrade) and about to install it. Be grateful for any advice as I do enjoy using the program if only I can resolve this issue.  I am not a PC wiz and mainly use Elements to catalogue photos from which I compile collections and from them slide shows with music.  Any advice appreciated Sonny.t PS Have tried to post this previously but without success so hoping to see message appear and a +response

    The organizer doesn't care where you send your photos when you download them via the downloader or where they happen to be when you first bring them in if you use the Get Photos command, but once your pics are in the Organizer, you *must* move them from within organizer or it can't find them. You don't have to use My Pictures at all if you don't want to, but regardless of the folder where you put your photos, if you want them someplace else, you use organizer to do it.

  • Query Help with Parent, Child, Child's Child

    Hi all,
    Need some help with a query.  I'm trying to create a stored procedure that is sort of like a Customer, Order, Order, Details.  In my situation the tables are different but nevertheless, I want to grab all the fields from the  Parent, Child,
    and Childs' Child, where the Parent.ParentID = @Parameter.  I tried this:
    CREATE PROCEDURE [dbo].[spGetCompleteProjectXML]
    @ProjectID int = 0
    AS
    SELECT *,
    (SELECT *,
    (SELECT *
    FROM PageControls
    WHERE (PageControls.ProjectPageID = ProjectPages.ProjectPageID))
    FROM ProjectPages
    WHERE (ProjectPages.ProjectID = @ProjectID))
    FROM Projects
    WHERE (ProjectID = @ProjectID)
    FOR XML AUTO, ELEMENTS
    RETURN 0
    I think I'm close, but it was my best effort.  Could someone help?
    thanks in advance

    Hi TPolo,
    Regarding your description, are you looking for a sample like below?
    CREATE TABLE customer(customerID INT, name VARCHAR(99))
    INSERT INTO customer VALUES(1,'Eric')
    INSERT INTO customer VALUES(2,'Nelson')
    CREATE TABLE orders(orderID INT,customerID INT)
    INSERT INTO orders VALUES(1,1);
    INSERT INTO orders VALUES(2,1)
    INSERT INTO orders VALUES(3,2)
    INSERT INTO orders VALUES(4,2)
    CREATE TABLE orderDetails(orderID INT,item VARCHAR(99))
    INSERT INTO orderDetails VALUES(1,'APPLE1')
    INSERT INTO orderDetails VALUES(1,'BANANA1')
    INSERT INTO orderDetails VALUES(2,'APPLE2')
    INSERT INTO orderDetails VALUES(2,'BANANA2')
    INSERT INTO orderDetails VALUES(3,'APPLE3')
    INSERT INTO orderDetails VALUES(3,'BANANA3')
    INSERT INTO orderDetails VALUES(4,'APPLE4')
    INSERT INTO orderDetails VALUES(4,'BANANA5')
    SELECT customer.customerID,customer.name,
    (SELECT orderId,
    SELECT item FROM orderDetails WHERE orderID=orders.orderID FOR XML AUTO,TYPE,ELEMENTS
    FROM orders Where customerID=customer.customerID FOR XML AUTO,TYPE,ELEMENTS)
    FROM customer WHERE customerID=1
    FOR XML AUTO,ELEMENTS
    DROP TABLE customer,orderDetails,orders
    If you have any feedback on our support, please click
    here.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for

  • How could i display  india as  i  n  d i a in rowize

    how could i display india as i n d i a in rowize in oracle query output i n d i a (i am newbiee to this forum ,i dont know on which category i should post this question is there any general category for orcle questions?) thanks

  • Report workflow

    Hi, I created a workflow for approval appropriation request. There are various approval levels for an appropriation request. Is there a report that show me, who process the appropriation request at a given time? More precisely, is there a report that

  • SRM - Purchase order approval date in BC Extractor

    Hello all, is there any way to get the Approval date (date on which the processing status of the PO) in BI. So far I can see, just the processing status is available in Datasource 0SRM_TD_PO, but how can I provide the belonging date within a BI query

  • Alphabetize Bookmarks folders in the Bookmarks column

    Could anybody tell me how to alphabetize Safari's bookmarks folders in the Bookmarks column other than doing it by hand one at a time??? Appreciate your help Al

  • Safari Locking up with I download something

    When ever I download something via Safari Safari always locks up. The download window shows the file and says preparing to download, it will sit this way with a spinning beach ball for about 30 seconds then download just fine. Any ideas?