How can I select only the records that have more than 1 attached userID?

gurus of the afternoon...

As queries title, I can't find examples by searching the forum then...

Basically, I need to find all the web_user_ids who have more than 1 attribute_code of 'ICX_HR_PERSON_ID' in the table... I tried this but its is not as much as I think it should...

SELECT web_user_id, attribute_code, number_value, COUNT (web_user_id)
AS "Num of administrators."
OF AK_WEB_USER_SEC_ATTR_VALUES
-WHERE attribute_code = 'ICX_HR_PERSON_ID '.
- AND web_user_id = '4123'
Web_user_id GROUP, attribute_code, number_value
SEEN (COUNT (web_user_id) > 1)
ORDER BY web_user_id ASC;

Val

J

Try:

SELECT web_user_id, attribute_code, COUNT(web_user_id)
AS "Num Of Administrators"
FROM AK_WEB_USER_SEC_ATTR_VALUES
WHERE attribute_code = 'ICX_HR_PERSON_ID'
GROUP BY web_user_id, attribute_code
HAVING (COUNT(web_user_id) > 1 )
ORDER BY web_user_id ASC;

Or, better, there is no need to extract the attribute_code:

SELECT web_user_id, COUNT(web_user_id) AS "Num Of Administrators"
FROM AK_WEB_USER_SEC_ATTR_VALUES
WHERE attribute_code = 'ICX_HR_PERSON_ID'
GROUP BY web_user_id
HAVING (COUNT(web_user_id) > 1 );

Max

Published by: Massimo Ruocchio, November 12, 2009 16:28

Tags: Database

Similar Questions

  • Query to retrieve records that have more than one assignment_id

    Hello

    I'm writing a query to extract all records in the table per_all_assignments_f that has more than one different assignment_id for each person_id. Here's the query I wrote, it retrieves the records, even if a person_id assignment_id duplicate, but I need records that have more than one assignement_id without duplicate for each person_id

    Select assignment_id, person_id, assignment_id
    Of per_all_assignments_f
    Having count (assignment_id) > 1
    Person_id group, assignment_id

    Thank you.
    PK

    Maybe something like that?

    select *
    From   per_all_assignments_f f1
    where  exists (select 1
                   from   per_all_assignments_f f2
                   where  f2.person_id = f1.person_id
                   and    f2.assignment_id != f1.assignment_id
                  );
    

    Published by: SomeoneElse on May 7, 2010 14:23

    (you can add a SEPARATE from the outer query if you wish)

  • How can I select only the lowest layer?

    On the Adobe site, he States:

    If you need the lowest layer selected, press Option + shift + -[.]

    Well, it does not work for me in all cases as if another layer is selected, both end up being selected.

    Inside of an Action, how can I select the lowest layer and only the lowest layer?

    And while I ask questions of Action, in an existing action, how do I start recording so that the new shares are placed right at the top? If I select the name of the Action, the new record is placed in the lower part. If I select the first element, the new record is ranked second.

    See if Option +, (comma) selects the lower layer.

    And Option +. (period) selects the top layer.

  • How to select all the records that have the difference of two dates of greater than a value

    Hi all

    I have a table as below:

    ID creation_date Modify_date

    --                -------------                                                            -----------

    1 10:11:07.243000000 JANUARY 7, 14 H 10:16:16.865000000 7 JANUARY 14 H

    2 13 JANUARY 14 12:07:27.603000000'M 12:08:09.955000000 13 JANUARY 14: 00

    I want to select all the IDs that is difference of Modify_date and creation_date is greater than 5 minutes.

    Please suggest how to achieve this goal, oracle database.

    TIA,

    Bob

    Select *.

    from table_name

    where (Modify_date - creation_date) * 1440 > = 5


    for timestamp:

    Select *.

    from table_name

    where extract (minute (Modify_date - creation_date)) > = 5



    -----

    Ramin Hashimzade

  • How can I count only text fields that have been used?

    Hello

    I use Livecycle Designer to a dynamic form.  I have a section of the form that contains the field for the user to enter the goals, and then note the purpose.  I want to count only the text fields with entries and have the total number of rates, divided by the number of entries in text field.

    Line 1, column 1 - goal is to collect 5 apples.   Line 1, column 2 - the given rate is 5

    Row 2, column 1 - goal is to collect 5 pears.  Line 1, column 2 - the given rate is 5

    Two goals for a total power of 10-10 divided by 2 = 5

    Is it possible to count only the fields that are populated?

    Also, is it possible to create an error message if the user scored 5 goals but rated only 4 of them?

    Please send me the form to

    [email protected]. I'll get it repaired for you and send it back and then you'll have the code in the form of sample for later reference.

  • Selection of the records that have no referencing records at a small price

    I try to get records that has no records of references. Here's the script and test the query I wrote to get the result.
    I can get result, but my problem is to lower the cost. This table has more than 50,000 rows. Hope someone can guide me to write a better query.

    create table ot_req (rh_sysid rh_txn_type VARCHAR2 (NO.4), rh_ref_sys_id (5), (4), rh_ref_txn_cod VARCHAR2 (5));

    INSERT INTO ot_req VALUES (800, 'MR SS', NULL, NULL);
    INSERT INTO ot_req VALUES(801,'SSPR',800,'SSMR');
    INSERT INTO ot_req VALUES(810,'SSMR',,);
    INSERT INTO ot_req VALUES(811,'SSMR',,);
    INSERT INTO ot_req VALUES(812,'SSMR',,);
    INSERT INTO ot_req VALUES(813,'SSPR',812,'SSMR');
    INSERT INTO ot_req VALUES(814,'SSMR',,);
    INSERT INTO ot_req VALUES(815,'SSPR',814,'SSMR');


    SELECT
    rh_sysid
    Of
    ot_req
    WHERE
    rh_sysid
    PO NO
    (SELECT
    rh_ref_sys_id
    Of
    ot_req
    WHERE
    rh_ref_sys_id IS NOT NULL)
    AND
    rh_txn_type! = "SŠPR";

    Result

    RH_SYSID
    810
    811

    Looking forward to your support.

    Thanks in advance :)

    Unus wrote:
    My problem is to lower the cost.

    rh_ref_sys_id will never be sšpr. Only sšpr will reference number

    SQL> exec dbms_stats.gather_table_stats(user,'ot_req')
    
    PL/SQL-procedure is geslaagd.
    
    SQL> set autotrace on
    SQL> select rh_sysid
      2    from ot_req
      3   where rh_sysid not in
      4         ( select rh_ref_sys_id
      5             from ot_req
      6            where rh_ref_sys_id is not null
      7         )
      8     and rh_txn_type!='SSPR'
      9  /
    
      RH_SYSID
    ----------
           810
           811
    
    2 rijen zijn geselecteerd.
    
    Uitvoeringspan
    ----------------------------------------------------------
    Plan hash value: 2746377339
    
    -----------------------------------------------------------------------------
    | Id  | Operation          | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |        |     5 |    60 |     7  (15)| 00:00:01 |
    |*  1 |  HASH JOIN ANTI SNA|        |     5 |    60 |     7  (15)| 00:00:01 |
    |*  2 |   TABLE ACCESS FULL| OT_REQ |     5 |    50 |     3   (0)| 00:00:01 |
    |*  3 |   TABLE ACCESS FULL| OT_REQ |     3 |     6 |     3   (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("RH_SYSID"="RH_REF_SYS_ID")
       2 - filter("RH_TXN_TYPE"<>'SSPR')
       3 - filter("RH_REF_SYS_ID" IS NOT NULL)
    
    Statistics
    ----------------------------------------------------------
              1  recursive calls
              0  db block gets
             14  consistent gets
              0  physical reads
              0  redo size
            469  bytes sent via SQL*Net to client
            416  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              2  rows processed
    
    SQL> select nvl(rh_ref_sys_id,rh_sysid) rh_sysid
      2    from ot_req
      3   group by nvl(rh_ref_sys_id,rh_sysid)
      4  having count(*) = 1
      5  /
    
      RH_SYSID
    ----------
           810
           811
    
    2 rijen zijn geselecteerd.
    
    Uitvoeringspan
    ----------------------------------------------------------
    Plan hash value: 2435394825
    
    ------------------------------------------------------------------------------
    | Id  | Operation           | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |        |     1 |     6 |     4  (25)| 00:00:01 |
    |*  1 |  FILTER             |        |       |       |            |          |
    |   2 |   HASH GROUP BY     |        |     1 |     6 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| OT_REQ |     8 |    48 |     3   (0)| 00:00:01 |
    ------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter(COUNT(*)=1)
    
    Statistics
    ----------------------------------------------------------
              1  recursive calls
              0  db block gets
              7  consistent gets
              0  physical reads
              0  redo size
            469  bytes sent via SQL*Net to client
            416  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              2  rows processed
    

    Kind regards
    Rob.

  • Filter-stupid question - how to filter on ONLY the images that have changes?

    I'm looking to filter images that have been changed since the import.  The change could be in lightroom, or external.  I have a setup of filter for external files, but I can't find out what filter to use to display files that have been modified within lightroom.

    I hope that my request is logical.  I find I have more changes in Lightroom (3.5) these days and want to filter (without setting of flags/stars/colors /...) on the images that I've already changed.  Is this possible?

    Thank you

    Chris

    You can restrict the results of the smart collection 'A adjustments' to just a single folder.  First, click on the smart collection ' adjustments ', and then Ctrl-click (command-click on Mac) on the folder you want.  The results will be only photos in the folder with settings.

  • How can I access an unread email that is more than 2 weeks old?

    I went on vacation and do not use my email for more than two weeks.  Now when I try to pass messages that were received during this period of time he told me to go into the settings and there is no solution here.  Some of them came to my office and people do not forget what they have done!

    Ellen

    Looks like you are using the metro App Windows Mail. Is this RT for Windows (or later) or Windows 8 (or later)?

    Click or tap

    to read messages in addition to two weeks, go to settings

    You should be able to access this option from there.

    optional: I recommend something other than Windows Mail. If you are on Windows 8 or later, you can switch to Windows Live Mail free. (Make sure that you perform a custom installation and reduce other unwanted programs)

  • How to read/select only the records from a table with non-English characters

    Hello
    I need to find all records in a table with non-English (mainly Chinese) characters in at least one of the varchar2 columns. Let me kow if someone knows a way by which it can be done using SQL/PLSQL.

    Best regards
    Imran
    select * from your table
    where your_column != convert(your_column, 'UTF8', 'US7ASCII)
    

    Replace UTF8 with your database character set

    Published by: thtsang on October 15, 2009 03:53 - unequal sign change of! =

  • How can I add only the fields whose value is greater than an amount established in a calculation?

    I have a form of Life Cycle PDF Creator with user input fields.  I want to add ONLY the items that are more than $25. Any help would be appreciated.

    Thank you.

    I fixed it for you - YAY

    https://www.dropbox.com/s/zbt89nxk6zv0uq2/EQUALIZERx%289-15%29v2%20data%20ADDED%2001%20DON E.pdf? dl = 0

    I sympathize with your feeling about MS EXCEL, but ultimately, LiveCycle (and the complex needs of coding) are the only way to provide solutions that cannot be ruined by other people.

    I always struggle with 'for' loops - they are not nearly as intuitive that 'if, else' built BUT mastering all the two of these buildings gives you 95% of the functionality you could out EXCEL.

    Articles/examples of BRINKMAN (google page break) and NIALL (google ensure dynamic) helped a lot to improve my command of LiveCycle Designer.

  • How to find the names of tables that have more than 100 columns

    Hi gurus,

    Please help me find the names of the tables that have more than 100 columns in the database.

    Below will be useful for you.

    SELECT atc.OWNER,atc.TABLE_NAME,count(*)
    FROM all_tab_columns atc
    GROUP BY  atc.OWNER,atc.TABLE_NAME
    HAVING count(atc.COLUMN_NAME) > 100
    

    Adding another point, you can use user_tab_columns, all_tab_columns, dba_tab_columns, based on your needs/access.

    Thank you
    Suri

    Published by: Suri on February 23, 2012 11:30

  • How can I print only the part selected a page?

    When I highlite prints part of the entire page. How can I print only the part selected page?

    Try:

    Highlite your text

    Press CTRL + P to start the print menu

    "All" is selected by default in the scope . Change it by selecting 'selection ', and then click OK.

    This example shows only the text that is selected. Microsoft® Security MVP, 2004-2009

  • I use LRM6 with Win7.  Cannot display all of the subfolders on external drive with photos.  Can't see most recent used folders.  How can I get all the records to display in the tree when the library module?

    I use LRM6 with Win7.  Cannot display all of the subfolders on external drive with photos.  Can't see most recent used folders.  How can I get all the records to display in the tree when the library module?

    Syrup72 wrote:

    Why I see pictures when I click on the tab all the photos above, which do not show in the tree on the G: drive?

    DSC_2429 is in the shown locaton and present in all the Photos, but there is no folder "Tulsa"... "in the tree.

    The left pane is a "choose one". "All photos" are just that. 'G' is a different option.

    Lightroom is not a file Explorer. He knows only the drives and files that you have imported the photos of. If LR shows not all of the photos that are on your hard drive, it is because you did not import all photos.

    If LR shows you a photo in "all photos" but do not show it in the folder you think he is in, go to "all photos", select the image, right click "view in the library folder. This will show you where LR think the picture is.

  • How can I transfer only the music I want?

    Hello.

    Our iMac iTunes is full of music for the whole family. How can I transfer only the songs I want on my iPod and my iPad?

    Second...

    When connecting from my iPad to my iMac USB cable the iPad goes into sync mode and transfers all sorts of things on the iMac and gets things from him. All I want is to transfer my music? How can I do this?

    Create your own playlists in iTunes.

    Connect your iDevice to the iMac - in the main iTunes window select your iDevice - menu drop-down upper left box located to the left of the music-movies, etc.

    You will see a list of 'Settings' for this device - select a tab and check the boxes of what content you want on your device.

    Also in the Group of settings select 'Summary' - from there, in the 'Options' section, you have a few additional items to choose from.

    MJ

  • How can I print just the screen that I'm looking?

    • How can I print just the screen that I'm looking? CTRL + P doesn't (I have WIndows Vista)

    auntjilly wrote:

    * How can I print just the screen watching you? CTRL + P doesn't (I have WIndows Vista)

    Two ways:

    (1) by design, as it has always been with all versions of Windows, press copy the entire screen, including the wallpaper desktop, in the Clipboard (iow, in RAM).  By pressing + of only copies the active window to the Clipboard.  To view the screenshot, open a graphics program, such as MS Paint and press + V.  This will paste the contents of the Clipboard (your screenshot) in the file open and allows you to view or save it as a file for later use.

    How to capture screenshots in Windows by using the print screen key
    http://support.Microsoft.com/default.aspx?scid=kb; us; 173884

    (2) as long as you have a newer version of Vista as the Home Basic edition, you can use the Snipping Tool.  (Start > all programs > Accessories).

    Bruce Chambers

    Help us help you:
    http://www.CatB.org/~ESR/FAQs/smart-questions.html

    http://support.Microsoft.com/default.aspx/KB/555375

    They who can give up liberty to obtain a little temporary safety deserve neither liberty nor safety. ~ Benjamin Franklin

    A lot of people could die rather that thinking; in fact, most do. ~ Bertrand Russell

    The philosopher never killed the priests, while the priest killed a large number of philosophers.
    ~ Denis Diderot

Maybe you are looking for

  • 'Open in Chrome' Addon user cannot open certain websites

    Hello I just stumbled across this comment https://addons.mozilla.org/de/firefox/addon/open-with-google-chrome/reviews/727928/ associated with this https://addons.mozilla.org/de/firefox/addon/open-with-google-chrome/?src=hp-dl-upandcoming 'Up & Coming

  • Plug-in for LS-Dyna files

    Hello I was hoping that someone could help with a plug-in for LS-Dyna (CAE Solver) output files.  I have attached a force (rcforc) and node (nodout) data files.  The format is strange to me and the wizard could not help... In addition, these files do

  • remove the automatic photo assistant when I want to print.

    I don't want the photo popup Wizard to guide me through the selection how to print my photos. I want to make that selection through various programs myself.

  • R51 2887 ql7 RAM Upgradation

    Hello I'm new to this community. I bought laptop IBM R51 2887 ql7 3 years back. Now, I want to upgrade the RAM as possible max. Currently, it has only 256 MB of RAM. Can you get it someone pls let me know... 1. to extend the RAM is possible (1 GB or

  • Ricambi laptop (617298)

    Buongiorno, e fornibile the motherboard by laptop computer Latitude E5540 express service code 3943763030 service tag 1T80J12? MI fate is prezzo, tempi di delivery sapere e di supply terms? Grazie Sara Landoni