Separate record help!

Hi all

Hope you are doing great!

I have the following query.

SELECT DISTINCT DT. STD_ID STDID,
UPWARD. FIRST_NAME, FIRSTNAME,
UPWARD. LAST_NAME LASTNAME,
GTM ROLE TYPE,
NVL2 (C. USER_ID, 'Y', 'N') CKCTEAM,.
CT. USER_ID
BY AGREEMENT, D.
DEAL_TEAM DT,
CKC_TEAM CT,
USER_PROFILE UPWARD
WHERE D.DEAL_ID = DT. DEAL_ID
AND DT. STD_ID = UPWARD. STD_ID
AND D.DEAL_ID = 'D0002064 ';

And the following result.


STDID FIRSTNAME LASTNAME ROLE CKCTEAM USER_ID
V285773 MAHIA ANNA CREATEBY Y E067448
E015989 GAY CARR EDITOR Y E067448
V285773 MAHIA ANNA BANKER Y E067448
O256285 ALLA OLWEN EDITOR Y E067448


I need the results to have separate records based on the first name and last name independent roles. Now you can see on the result set that there is a duplicate for 'MAHIA ANNA' as the user has 2 different roles.

Appreciate your help on this.


Thanks in advance
MN

But what is the role you want to see of MAHIA ANNA?

You can use the group clause such as

SELECT max(DT.STD_ID) STDID,
UP.FIRST_NAME FIRSTNAME,
UP.LAST_NAME LASTNAME,
max(DT.TYPE) ROLE,
max(NVL2 (CT.USER_ID, 'Y', 'N')) CKCTEAM,
max(CT.USER_ID)
FROM DEAL D,
DEAL_TEAM DT,
CKC_TEAM CT,
USER_PROFILE UP
WHERE D.DEAL_ID = DT.DEAL_ID
AND DT.STD_ID = UP.STD_ID
AND D.DEAL_ID = 'D0002064' group by FIRST_NAME, LAST_NAME;

Tags: Database

Similar Questions

  • a few fields in double writing to another table with separate records

    I have a requirement to write a few fields in duplicate a table and writes the separate records to another table. Please find the script below and share your ideas

    TableName: EMP_DETAIL

    EMPNO Date of birth CITY STATE GRADE
    12305051982FREMONTCAA
    45605051982FREMONTCAB
    78905051982FREMONTCAC
    22202021975SANJOSECAD

    (1) in table EMP_DETAIL, if we have duplicate fields date of birth, CITY AND STATE and take everything save random duplicates of this field and write in another table EMP_DETAILS_DISTINCT

    EXPECTED RESULTS: EMP_DETAILS_DISTINCT

    EMPNO Date of birth CITY STATE GRADE
    12305051982FREMONTCAA
    22202021975SANJOSECAD

    (2) in the EMP_DETAIL table, I want to search only duplicates of birth date, CITY AND STATE fields and write only duplicate in another EMP_DETAILS_DUPLICATE table records

    EXPECTED RESULTS: EMP_DETAILS_DUPLICATE


    EMPNO Date of birth CITY STATE GRADE
    12305051982FREMONTCAA
    45605051982FREMONTCAB
    78905051982FREMONTCAC


    Thank you!

    For the first query

    1) insert into EMP_DETAILS_DISTINCT select * from EMP_DETAIL where rowid in (select min (rowid) of the EMP_DETAIL group by date of birth, CITY, STATE);

    For the second query

    (2) insert into select EMP_DETAILS_DUPLICATE * from EMP_DETAIL where rowid not in (select min (rowid) of the Group EMP_DETAIL by DOD, CITY, STATE)

    Hope this will help you.

    Good day.

  • Where is 'Create a separate record for each volume' past? in VMware-converter - 4.0.1 - 161434.

    Where is 'Create a separate record for each volume' past? in VMware-converter - 4.0.1 - 161434 (independent). Option is not more than 4 converter?

    Hello.

    When you get to the third tab called "View/Edit Options", choose the Edit option for 'Data to copy.'  Then choose the option advanced at the end of the menu "data copy type" and then use the options on the page layout tab target to assign separate discs.

    Good luck!

  • Need help to group the separate records

    Hi Experts,

    Please help me with the problem below:

    Here's the data I have on the table A-

    Name Col_1 Col_2 Num_1 Num_2
    Mark123ABC001 A700100
    Mark123ABC001 A70050
    Mark123ABC001 A300100
    Jane700 A7321A4060
    Jane700 A7321A60

    60

    Jane700 A7321B2010

    Here is the result that I have need-

    Name Col_1 Sum (Num_1) Sum (Num_2)
    Mark123ABC1000150
    Jane700 A12070

    I tried the following and you can accomplish the same thing in 2 selects different, but I need the results in 1 line:

    For the SUM (Num_1)

    SELECT t1.name
         , t1.col_1
         , SUM(t1.num_1)
    FROM
    (SELECT DISTINCT name
         , col_1
         , col_2
         , num_1
    FROM a) t1
    GROUP BY t1.name, t1.col_1;
    
    

    For the SUM (Num_2)

    SELECT t1.name
         , t1.col_1
         , SUM(t1.num_2)
    FROM
    (SELECT DISTINCT name
         , col_1
         , col_2
         , num_2
    FROM a) t1
    GROUP BY t1.name, t1.col_1;
    
    

    Is there a way I can get the results in 1 Select?

    Any help would be greatly appreciated.

    I'm using Oracle 11.2.0.1.

    Thank you

    Post edited by: 1014077 - removed incorrect alias.

    select name, col_1, sum(num_1), sum(num_2)
    from (select distinct name, col_1, col_2, num_1, 0 num_2 from a union all select distinct name, col_1, col_2, 0 num_1, num_2 from a)
    group by name, col_1, col_2;
    

    Untested code

  • separate records of xmlattributes

    help please.

    It works and I need except a problem, for some reason any its generators of number of rows as there are in fact. There are 3 separate recordings of what and 7 separate P_name records, but when you run this I get 33 each (duplicates of each)

                                                 select Xmlelement ( "my_LEGEND ", 
                          
                            Xmlelement("PS",
                          
                                          xmlagg(Xmlelement("P",
                                          
                                                    Xmlattributes (a.F_name As "pname")
                                                                      )
                                                    )
                                            ),
                            Xmlelement("FS",
                                              
                                          xmlagg(Xmlelement("F",
                                          
                                                    Xmlattributes (b.F_name As "fname")
                                                                      )
                                                    )
                                              )           
                                              
                                          )
        
            From (Select Distinct P_name From table1)  A,  (Select Distinct F_name from table1) B
    I want to just two nodes under my_legend and each has distinct values (P_name and what)
    they do not need to be joined or whatever it is.

    Hello

    I want to just two nodes under my_legend and each has distinct values (P_name and what)
    they do not need to be joined or whatever it is.

    Do not join them then.

    As far as I understand, you need something like this:

    select Xmlelement( "my_LEGEND ",
             Xmlelement("PS",
               (
                 select xmlagg(
                          Xmlelement("P", Xmlattributes (a.F_name As "pname"))
                        )
                 from ( Select Distinct P_name From table1 ) a
               )
             )
           , Xmlelement("FS",
               (
                 select xmlagg(
                          Xmlelement("F", Xmlattributes (b.F_name As "fname"))
                        )
                 from ( Select Distinct F_name from table1 ) b
               )
             )
           )
    From dual ;
    

    (could be more optimized, but I can't test)

  • Replace the audio with and synchronizing with separate record

    Hello

    I read everything I can find, including many websites, the help file and a book, but can not find this response with instructions step by step using first Elements 9.

    I have the trial version and will purchase once I have understand that. I just need to make Youtube videos with a separately recorded audio file replaces the audio that is already on the video. in other words, I have a separate audio file to Mp3 of the same audio performance with an audio recorder and I want to replace the original video with the other Mp3 audio.

    What are the steps to ensure that the new audio is in sync with the audio already on video, from the original recordings and working through to the finished product?

    Thank you.

    I'm not Steve, but will offer my thoughts:

    • Most of the PrE users use Audio from their cameras, and less use separate devices, although I see more and more that.
    • Most of the PrE users do not 'clips', but again once, I see more and more of this in this forum.
    • It is probably impossible that an author can cover all the possible uses of a program, as before, even if they made a version three volumes. There are simply too many possibilities. Maybe Steve should consider making a companion book to his great tips & tricks, along the lines of "really advanced uses for PrE?
    • If any covered Steve implement, we wouldn't have much to do in the forum...

    I'm glad you don't have Steve's PrE book. If you decide to go with the pre as your NLE program, in light of what you do, I would add also, her book tips & tricks that you will most likely receive the gems inside.

    Good luck and happy editing.

    Hunt

  • Hearing won't save my recording, HELP!

    I recently recorded song on hearing and when I finished recording, I pressed the stop button.but after that I pressed the stop button, it wouldn't save my file... so I checked my hd space and it turns out that there lack of hd space in the middle of my record! Hearing WTF! but the interesting thing is that the wav files were created during the whole verse, but only 15 seconds, record value is actually out with my song... Please how do I get it back!

    I HATE THIS PROGRAM WITH A PURE PASSION! @! @

    HELP PLEASE!

    Although the hearing will not give you a warning when becomes low available disk space (after all, he does not know how much time you will save because there he does not know how much space it will take), but it is displayed in the Status bar (bottom right) how much disk space is left and can show the available recording time.

  • You see does not separate records

    Try to understand something...

    Recently, I noticed in our instance DEV that a particular column when he is interviewed no longer displays the different records. It was at the same time, and I don't know what has changed or how to track down what has changed.

    When to check the "DISTINCT" LOG file in the query generated from the DEV server is not when the PROD server.

    DEV
    Select T628965. PERIOD_YEAR C1
    Of
    GL_PERIODS T628965
    where (T628965. PERIOD_SET_NAME = "END OF APRIL OF THE YEAR")
    order of c1

    PROD
    Select DISTINCT T628965. PERIOD_YEAR C1
    Of
    GL_PERIODS T628965
    where (T628965. PERIOD_SET_NAME = "END OF APRIL OF THE YEAR")
    order of c1

    I double checked the properties of database and check the separate option of the query

    We need to do a migration RPD prod, but I'm hesitant to do until I find what has changed.

    Any ideas on what to look in, I compared it to the layer MDB & physics as well as the allocation of level of hierarchy, but not having luck identifying the problem of the RPD.

    Thank you for any input,
    Jeremy

    Hello
    Repository opened in online mode, go to MDB later-> Table (expand it)--> Source (expand it)-> can see list of the LTS-> click soure where this column mapped-> Content tab (last)-> below, you can see the separate selection box.

    Kind regards
    Srikanth

  • I imported my last computer profile, but I can't find a way to make it active, and if records help says you can change profile, there is no indication how to proceed.

    I put the file in the Profiles folder and deleted the default profile, but nothing happens and I can't find an instruction in the menus to change profiles, nor anything in the fact sheets help to explain how.

    You must copy the file profiles.ini so or create a new profile and choose the imported profile as the location of this new profile make Firefox recognize and use it.

  • Separate records of mail for separate e-mail accounts.

    The problem is extremely simple; the problem is Outlook (Express or normal) or Windows Mail: I have several accounts of messaging (email, address) and I want to have a folder for each email account, so that I can partition my incoming mail into folders based on the address of the recipient. How can I still do this in Windows Mail? It is not specific to any OS, but covers all versions of Microsoft Outlook and Windows Mail. Newbie

    Outlook Express's identities to do that for you, Windows Mail does not work. There are four ways to solve this:

    1. use Windows user names. This gives a total privacy.

    2. apply message rules to filter incoming messages in separate folders.

    3. upgrade to Windows Live Mail , which has folders for each account, none of the rules is necessary:

    4. buy an add-on called WMIDs

    Outlook uses profiles that will do what you want, one profile per e-mail account.

    HAL

    --

    HAL Hostetler, TCE

    Engineer senior/UPDATED--MS MVP-Print/Imaging - WA7BGX

    www.kvoa.com - KVOA television, Tucson, AZ.

    Live Hot Licks - www.badnewsbluesband.com

  • Separate records, based on the condition of a table

    Hello PL/SQL gurus and experts.

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64-bit Production version
    I have table-

    Note - Table do not have a primary key on Order_ID.
    DROP TABLE T;
    create table T(Order_ID,Active_Flg) as select
    '201002', 'Y' from dual union all select
    '201002', '' from DUAL union all select
    '201003', '' from dual union all select
    '201004', 'Y' from DUAL union all select
    '201004', '' from dual union all select
    '201005', '' from DUAL ;
    I want to go get these Order_ID who have Active Flg as NULL and do not have the entry for Active_Flg = Y

    If use the following, then it returns the distinct Order_ID but not the expected-
    SELECT DISTINCT ORDER_ID FROM T WHERE ACTIVE_FLG IS NULL;
    Result-
    ORDER_ID
    ------
    201004
    201002
    201003
    201005
    Kindly help...

    This?

    select order_id
      from (
              select order_id
                   , active_flg
                   , count(decode(active_flg, 'Y',1)) over(partition by order_id) cnt1
                   , count(decode(active_flg, null,1)) over(partition by order_id) cnt2
                from t
           )
     where cnt1 = 0 and cnt2 > 0;    
    
  • Adding record helps the dynamically nested table

    Hello guys im trying to add records to a nested table plsql dynamically. Here is my code that only adds a record. I can not figuered on why it's not more then add one record to the nested table. I think I would say at the table to update the index and insert the new index but I'm not sure on the index can someone throw me a BONE.
    I also tried the records, but I seem to be facing the same problem.
    create or replace
    PROCEDURE QUICKTEST AS 
    BEGIN
    /*declare and array to loop through. to write error log.*/
    declare
    TYPE local_table IS TABLE OF VARCHAR2(30);
    acct_code local_table;
    
    
    TYPE rec_type IS RECORD (       -- local RECORD type
        f1 INTEGER,
        f2 VARCHAR2(4)
      );
      r2     rec_type;                -- local type
    
    num number(17):=0;
    
    begin
    FOR Lcntr IN 1..20
    LOOP
        
        
         acct_code := local_table ('I');
         r2.f2 := num+1;
        
    num:=num+1;
    
    END LOOP;
    
    END QUICKTEST;

    I think you are looking for something in the lines of...

    CREATE OR REPLACE PROCEDURE quicktest
    AS
       TYPE local_table IS TABLE OF VARCHAR2(30);
    
       acct_code   local_table  := local_table();
    
       TYPE rec_type IS RECORD(   -- local RECORD type
          f1   INTEGER
         ,f2   VARCHAR2(4)
       );
    
       TYPE rec_type_arr IS TABLE OF rec_type
          INDEX BY BINARY_INTEGER;
    
       r2          rec_type_arr;   -- local type
       num         NUMBER(17)   := 0;
    BEGIN
       FOR lcntr IN 1 .. 20
       LOOP
          acct_code.EXTEND;
          acct_code(lcntr) := 'I' || lcntr;
          r2(lcntr).f1 := num + 1;
          r2(lcntr).f2 := 'J' || TO_CHAR(num + 1);
          num := num + 1;
       END LOOP;
    
       DBMS_OUTPUT.put_line(acct_code.COUNT);
       DBMS_OUTPUT.put_line(r2.COUNT);
    
       FOR i IN acct_code.FIRST .. acct_code.LAST
       LOOP
          DBMS_OUTPUT.put_line(acct_code(i));
       END LOOP;
    
       FOR i IN r2.FIRST .. r2.LAST
       LOOP
          DBMS_OUTPUT.put_line(r2(i).f1 || ' :: ' || r2(i).f2);
       END LOOP;
    END quicktest;
    /
    
  • Separate records of a file path

    Using the method app.activeDocument.path. Returns a path string that looks like this: / c/Temp/Test if the file is stored at C:\Temp\Test\FileNameHere.Format, or alternatively; If a folder name contains a space it looke like /c/Temp/Test%20Folder if stored in C:\Temp\Test Folder\FileNameHere.Format I'm looking for is a way to retrieve the name of the last file automatically no matter what it is (in this case 'Test' or 'Test case') and store it in a variable for later use.  Any ideas on how to do this?  Thanks for any help!

    dgolberg

    pathname var = decodeURI (app.activeDocument.path.name);

  • Multitrack recording - help

    I apologize if this sounds like a daft but im new request for registration.  I use hearing to record a song.  There are some guitar parts that I started to record approximately 2 minutes into the song.  How can I make these tracks start at 0:00. 00. the reason is that my friend to mix and master the song for me in another program.  If I copy all tracks hearing on cd, they will be out of sync when importing into another program, unless they all start at 0:00. 00.

    Or, if you generate a lot of silence and then mix with the desired clip later in the piece, you'll find yourself with a track full length... and no mixing involved.

    Bob

  • Need to separate records.

    DECLARE
    TYPE book_rec () IS RENDERING
    title VARCHAR2 (150)
    );
    TYPE book_rec_tab IS TABLE OF THE book_rec
    INDEX OF DIRECTORY;
    book_rec_tab v1.
    BEGIN
    -Here, I want to assign titles
    v1 (1) .title: = "Heading1";
    v1 (2) .title: = "Heading1";
    BECAUSE me IN v1. FIRST... v1. LAST
    LOOP
    Dbms_output.put_line (v1 (i) .title);
    END LOOP;
    END;

    Heading1 get printed twice.
    I need to duplicate records...

    Thank you
    Vinoth

    Published by: [email protected] on July 27, 2009 16:41

    Published by: [email protected] on July 27, 2009 16:42
    DECLARE
        TYPE book_rec IS RECORD (
           title   VARCHAR2 (150)
        );
        TYPE book_rec_tab IS TABLE OF book_rec
           INDEX BY VARCHAR2(150);
        v1   book_rec_tab;
        idx VARCHAR2(150);
     BEGIN
     --    here i want to assign the titles
        v1 ('title1').title := 'title1';
        v1 ('title1').title := 'title1';
         idx := v1.First;
        while idx is not null
        loop
          -- do something
          dbms_output.put_line(idx);
          idx := v1.Next(idx);
          end loop;
     END;
    

    Ravi Kumar

Maybe you are looking for

  • 16 GB of RAM in mid-2012 possible MacBook Pro 15 "?

    Hello I currently have 4 GB of RAM in my 15 "mid 2012 MacBook Pro. Can this computer take two 8 GB of RAM... Total of 16 GB? Thank you.

  • Firefox crashes consistently when they surf on Facebook or other sites.

    running firefox on win xp but problems still happen., gel, especially on facebook... what my internet service? What is comp. '? How will I know?original title: run firefox on win xp but problems still happen., gel, especially on facebook... would it

  • update to OS

    I'm always running Vista and upgrade to Windows 7 in order to maintain support and navigation features.

  • Vista Premium System Restore does not work

    Bought a Toshiba laptop Satelite (L505D-S5965, processor AMD Athlon Dual-Core QL-65, 3 GB SDRAM, 250 GB HDD) with Vista Home Premium.  I have 195 GB of free space.  Everything works well except the system restore.  Impossible to restore using the res

  • Version 4.1 ACS certificate problem

    Our self-signed certificate has expired and I tried to install a valid certificate of our internal CA. The generation of CSR, addition of our internal CA as a valid root, import and installation of the new key all seemed to go smoothly. However, when