separate account using the lookup table

How can I get a separate count of column values by using another table?

Let's say I want to get a separate account of all 'company_name' files in the 'emp' table that corespond (soccer match) with table of 'research', 'State' category.

What I want is to find charges for all businesses that have a value of 'california' in the 'Status' column of the 'search' Table. I want the output to look like:

Sears 17
Pennys 22
Marshalls 6
Macys 9

I want the result to show me the company names dynamically as I don't know what they are, just that they are part of the group 'State' in the lookup Table object. Does make sense?

M

If you want a counter for each value of rfs_category, but instead of rfs_category you want to display, it's translated value lookup_value_desc.

This should do it for you:

select lookup_value_desc, the_count
  from lookup
  join (select rfs_category, count(*) the_count
          from RFS group by rfs_category)
    on rfs_category = lookup_type;

Tags: Database

Similar Questions

  • How to create the formula with the lookup table

    Hi, I would like to convert formula in the below format of labview, no idea how this could be done more easy way?

    I intend to use the node form, but I'm not sure how to use the table of choice within the formula not or is that even possible?

    BR, Jani

    Dim dblLookUp (-) As Double = New Double (3, 1) {{4, 4}, {10, 200}, {60, 3000}, {100, 7000}}
       
    If dblAbsValue > = 0 and dblAbsValue<= dbllookup(0,="" 0)="">
    USB = dblLookUp (0, 1) / dblLookUp (0, 0)
    dblAbsValue = dblValue * USB
    ' lblMode.Text = 1
    ElseIf dblAbsValue > dblLookUp (0, 0) and dblAbsValue<= dbllookup(1,="" 0)="">
    USB = (dblLookUp (1, 1) dblLookUp (0, 1)) / ((1, 0) - dblLookUp dblLookUp (0, 0))
    dblValue = USB * dblAbsValue - USB * dblLookUp (0, 0) + dblLookUp (0, 1)
    ' lblMode.Text = 2
    ElseIf dblAbsValue > dblLookUp (1, 0) and dblAbsValue<= dbllookup(2,="" 0)="">
    USB = (dblLookUp (2, 1) dblLookUp (1, 1)) / (dblLookUp (2, 0) - dblLookUp (1, 0))
    dblValue = USB * dblAbsValue - USB * dblLookUp (1, 0) + dblLookUp (1, 1)
    ' lblMode.Text = 3
    ElseIf dblAbsValue > dblLookUp (2, 0) and dblAbsValue<= dbllookup(3,="" 0)="">
    USB = (dblLookUp (3, 1) dblLookUp (2, 1)) / (dblLookUp (3, 0) dblLookUp (2, 0))
    dblValue = USB * dblAbsValue - USB * dblLookUp (2, 0) + dblLookUp (2, 1)
    ' lblMode.Text = 4
    On the other
    dblValue = dblLookUp (3, 1) ' * Math.Sign (dblValue)
    ' lblMode.Text = 5
    End If

    Return dblValue * intSign

    Hello janijt,

    You can certainly use formula node for it. What you would do is to create a constant for the lookup table.

    Here is an implementation in MathScript node

  • Need to dimension aggregated using the summary tables

    Hello

    I have two made tables workdetail and worksummary. Worksummary is grouped in time Sun and workdetail is at the level of day Timedim.

    Now, I set up my business model with Timedim and secondary table work. (creates a hirerchy for time (year-month-day) Sun). Now I want to use the tables of worksummary, how can I include this in my business model. I know to create a new Source of logic and mentioning levels.

    My important question is what do I have to create another physical table for time-months? or can I use same calendar dim physical to use with the summary fact tables?

    the answer to your question is YES, to use aggregated summary tables, we have grouped the dimensions. Other wise data will be redundant and return values incosistent.

    In your case if you use the same table of Timedim-day level with summaries, data tables will be multiplied by 30 days due to the time-Sun monthkey will be repeated in several lines.

    the simplest solution is to create Time_Dim table view, select separate year, month, monthkey. This view returns only unique year-month. Thus, each month will have only one line.
    -> view to import in your physical layer and create a join with the fact summary table.
    -> The table of months (which is the point of view) in the logic time_dim as another source, mention levels.
    -> and include your table of facts in logical fact table and mention that the levels at months time Sun

    It will work. Let me know if I'm not clear. Also, we can expect further comments of experts.

    -Madan

  • My gmail and Icloud accounts disappear from the list under "Mailbox store" in the mail. When I try to recreate my gmail account using the "new mailbox...» "I get the message"this account already exists. " What can I do to recover my mailboxes.

    I use YOSEMITE 10.10.5.

    My gmail and Icloud mailboxes (and several smart mailboxes) disappear from the list under "Mailbox store" in the mail. When I try to recreate my gmail account using the "new mailbox...» "(using the sign on the side down and to the left of the screen in Mail +) I get the message"this mailbox already exists. ». What can I do to recover my mailbox?

    Restart the Mac and Mail.

  • A second iTunes for the same account using the phone?

    Say a password is forgotten and you do not have the password for the other music on the phone, can you buy extra pieces with a second iTunes account using the same iTunes library and transfer all the music on the iPhone?   This less recent purchased music (from the old account forgotten password) no longer works on the phone once you purchase music with the second account?   Reset I know can be done with http://iforgot.apple.com/ unfortunately it takes 24 hours to get some discount lists to zero because for some reason, I can not receive their e-mail.  And no it's not end up in my spam folder.

    Howdy has brody,

    Thank you for using communities Support from Apple.

    If you do not receive the password reset email to reset the password of your Apple ID, then I suggest that you follow the information below.

    If you don't receive your check or reset email

    I recommend going through this path, because if you download music with another Apple on your Mac ID, it will be locked for this Apple ID for 90 days.

    View and delete devices in iTunes

    Take care.

  • How to create the user account using the command?

    How to create the user account using the command?

    Open cmd as administrator, and then type the following commands one after the other

    NET user / add program mypassword
    net localgroup administrators program / add
    net share concfg * C:------/ grant: program, complete
    This will create a user account with the name "Program" and the password "MonMotpasse".

    You can create the user name and password of your choice.
  • How to set up a new email account using the same e-mail address of my old computer?

    How can I configure sup a new email account using the same e-mail address of my old computer?

    Hi Melanie,

    Are you referring to the Mail app or user login account?

    If you are referring to the Mail application, you can consult the following link: Set up Mail and add contacts

    If you are referring to the user login account, you can consult the following link: create a user account

    It will be useful.

    Keep us informed on the status of the issue.

  • Using the external table error

    Hi all

    This is the first time I use the external table for loading the data.

    I did these steps

    In the D:\sqlloade folder, I have my text file containing data example.txt

    I ran these queries

    CREATE OR REPLACE DIRECTORY  ext_tab_data AS 'D:\sqlloader';
    
    

    Directory created

    CREATE TABLE fxops.t_ext (
    t number
    )
    ORGANIZATION EXTERNAL (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY ext_tab_data
      ACCESS PARAMETERS (
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        MISSING FIELD VALUES ARE NULL
        (
         t number
        )
      )
      LOCATION ('sample.txt')
    )
    PARALLEL 5
    REJECT LIMIT UNLIMITED;
    
    

    create table

    When I tried to create a view on that table, he throws an error

    CREATE OR REPLACE VIEW fxops.t_view  AS
      SELECT *
      FROM   fxops.t_ext;
    
    SQL Error: ORA-06564: object EXT_TAB_DATA does not exist
    06564. 00000 -  "object %s does not exist"
    *Cause:    The named object could not be found.  Either it does not exist
               or you do not have permission to access it.
    *Action:   Create the object or get permission to access it.
    
    

    Sign in, and then run this:

    Select HOST_NAME from v$ instance;

    is this the same hostname that you are connected?

    Kind regards

    Harry

  • How to validate totall character in a file using the extrnal table

    Hi all

    I have an external as table below

    CREATE TABLE 'WE_INT '. "" XTB_INVADJ_FROM_POS ".

    ("TRANSACTIONDATE" VARCHAR2 (14 BYTE),

    VARCHAR2 (2 BYTE) "LOCATION_TYPE."

    VARCHAR2 (4 BYTE) "LOCATION_VALUE."

    VARCHAR2 (3 BYTE) "ITEM_TYPE."

    VARCHAR2 (13 BYTE) "ITEM_VALUE."

    VARCHAR2 (5 BYTE) "UPC_SUPPLEMENT."

    VARCHAR2 (2 BYTE) "INVENTORY_STATUS."

    VARCHAR2 (2 BYTE) "ADJUSTMENT_REASON."

    VARCHAR2 (1 BYTE) "ADJUSTMENT_SIGN."

    "SET AMOUNT" VARCHAR2 (8 BYTE).

    VARCHAR2 (4 BYTE) "ADJ_QTY_DECIMAL_VALUE".

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    DEFAULT DIRECTORY 'LOC_SOURCE_POS2RMS_INVADJ '.

    ACCESS SETTINGS

    (RECORDS DELIMITED BY NEWLINE

    CHARACTERSET WE8MSWIN1252

    STRING SIZES ARE IN BYTES

    WHEN LOAD)

    ((1:5) = "TDETL")

    )

    BADFILE "XTB_INVADJ_FROM_POS.bad."

    DISCARDFILE 'XTB_INVADJ_FROM_POS.dis '.

    LOGFILE "XTB_INVADJ_FROM_POS.log".

    FIELDS

    LTRIM

    (

    "TRANSACTIONDATE" POSITION (30:43) DATE,

    "LOCATION_TYPE" POSITION (44:45) TANK,

    "LOCATION_VALUE" POSITION (46:49) TANK,

    "ITEM_TYPE" POSITION (50:52) TANK,

    "ITEM_VALUE" POSITION (53:65) TANK,

    "UPC_SUPPLEMENT" POSITION (66:70) TANK,

    "INVENTORY_STATUS" POSITION (71:72) TANK,

    "ADJUSTMENT_REASON" POSITION (73:74) TANK,

    "ADJUSTMENT_SIGN" POSITION (75) TANK,

    "SET AMOUNT" POSITION (76:83) TANK,.

    CHAR POSITION (84:87) "ADJ_QTY_DECIMAL_VALUE".

    )

    )

    LOCATION

    ("inv.txt"

    )

    )

    REJECT LIMIT UNLIMITED;

    If you see my conetent file that it will be as below.

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-000000400000

    I want to validate the chracters total if this line is to have more or less of 87 87 he must raise the error.

    You can use a column in the external table that contains all characters and a view that selects in the outer table, limiting the lines based on the length of the column that contains all characters, such as shown below.  You can create a separate view for those! = 87 if you want a list of releases.

    Scott@orcl12c > c:\my_oracle_files\inv.txt TYPE of HOST

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000040086

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-000000400087

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-0000004000088

    Scott@orcl12c > CREATE or REPLACE DIRECTORY LOC_SOURCE_POS2RMS_INVADJ AS 'c:\my_oracle_files '.

    2.

    Created directory.

    Scott@orcl12c > external_table CREATE TABLE

    2 ("TRANSACTIONDATE" VARCHAR2 (14 BYTE),

    VARCHAR2 (2 BYTE) 3 'LOCATION_TYPE. "

    VARCHAR2 (4 BYTE) 4 "LOCATION_VALUE."

    VARCHAR2 (3 BYTE) 5 'ITEM_TYPE. "

    VARCHAR2 (13 BYTE) 6 "ITEM_VALUE."

    VARCHAR2 (5 BYTE) 7 "UPC_SUPPLEMENT."

    VARCHAR2 (2 BYTE) 8 "INVENTORY_STATUS."

    VARCHAR2 (2 BYTE) 9 "ADJUSTMENT_REASON."

    10 'ADJUSTMENT_SIGN' VARCHAR2 (1 BYTE),

    11 "SET AMOUNT" VARCHAR2 (8 BYTE).

    VARCHAR2 (4 BYTE) 12 "ADJ_QTY_DECIMAL_VALUE."

    13 total_characters VARCHAR2 (255)

    14)

    15 EXTERNAL ORGANIZATION

    16 (TYPE ORACLE_LOADER

    17 DEFAULT DIRECTORY 'LOC_SOURCE_POS2RMS_INVADJ '.

    18 ACCESS SETTINGS

    19 (RECORDS DELIMITED BY NEWLINE

    CHARACTERSET 20 WE8MSWIN1252

    21 STRING SIZES ARE IN BYTES

    22 LOAD WHEN)

    23 ((1:5) = "TDETL")

    24)

    25 BADFILE "XTB_INVADJ_FROM_POS.bad."

    26 DISCARDFILE 'XTB_INVADJ_FROM_POS.dis '.

    27 LOGFILE "XTB_INVADJ_FROM_POS.log".

    28 FIELDS

    LTRIM 29

    30        (

    31 "TRANSACTIONDATE" POSITION (30:43) DATE,

    32 'LOCATION_TYPE"POSITION (44:45) TANK,

    33 "LOCATION_VALUE" POSITION (46:49) TANK,

    34 'ITEM_TYPE"POSITION (50:52) TANK,

    35 'ITEM_VALUE' POSITION (53:65) TANK,

    36 "UPC_SUPPLEMENT" POSITION (66:70) TANK,

    37 "INVENTORY_STATUS" POSITION (71:72) TANK,

    38 "ADJUSTMENT_REASON" POSITION (73:74) TANK,

    39 'ADJUSTMENT_SIGN' POSITION (75) TANK,

    40 "SET AMOUNT" POSITION (76:83) TANK,.

    41 'ADJ_QTY_DECIMAL_VALUE' POSITION (84:87) TANK,

    42 total_characters POSITION(1:255) TANK

    43        )

    44                  )

    LOCATION 45

    46 ("inv.txt"

    47         )

    48)

    RELEASE 49 UNLIMITED LIMIT

    50.

    Table created.

    Scott@orcl12c > SELECT * from external_table

    2.

    TRANSACTIONDAT LO LOCA ITE ITEM_VALUE UPC_S IN AD AN ADJ_ ADJUSTME

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

    TOTAL_CHARACTERS

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

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 086

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

    040086

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0087

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

    0400087

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0008

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

    04000088

    3 selected lines.

    Scott@orcl12c > external_table FROM SELECT LENGTH (total_characters)

    2.

    LENGTH (TOTAL_CHARACTERS)

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

    86

    87

    88

    3 selected lines.

    Scott@orcl12c > xtb_invadj_from_pos VIEW to CREATE or REPLACE AS

    2. SELECT "TRANSACTIONDATE"

    3 "LOCATION_TYPE."

    4 'LOCATION_VALUE. "

    5 "ITEM_TYPE."

    6 "ITEM_VALUE."

    7 "UPC_SUPPLEMENT"

    8 "INVENTORY_STATUS"

    9 "ADJUSTMENT_REASON."

    10 "ADJUSTMENT_SIGN."

    11 "QUANTITY ADJUSTMENT."

    12 'ADJ_QTY_DECIMAL_VALUE '.

    13 FROM external_table

    14 WHERE the LENGTH (total_characters) = 87

    15.

    Created view.

    Scott@orcl12c > SELECT * FROM xtb_invadj_from_pos

    2.

    TRANSACTIONDAT LO LOCA ITE ITEM_VALUE UPC_S IN AD AN ADJ_ ADJUSTME

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

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0087

    1 selected line.

  • problem in the form of master-detail when you use the ADF table for detail

    Hello

    jdev version - 11.1.2.1.0


    I create master shape detail using datacontrol drag as ADF master shape secondary Table.


    Now when I create a new line in the detail table using the key CreateInsert a new empty row created on top of the secondary table.

    and other show line that the previous record data based on the master.

    problem is I want to when I click on the createInsert button all the line of the secondary table must be empty and what line to fill two or three user then validate.



    Thanks in advance

    Hello

    If a secondary table has data, then createInsert adds to them. If you want to hide the existing lines, create a new instance of the View object and set the option "extract database" to "No. Rows. Use an af:switcher to change the specified table when the user clicks the createInsert button. There is some coding needed to have this use case in the ADF, but its essentially declarative. Bottom line, is that there is no option automated other than to create new lines in a separate page or dialog box if you are bothered by existing lines

    Frank

  • level of access to the lookup table

    I use Dreamweaver CS4. It seems that access levels can if apply (at least through server behaviors) to a field in the same table that host users and their associated passwords. I adopted a database that contains a table that contains the users and their passwords and access levels are stored in a lookup table. Outside hand coding this or the change in the structure of the table to include levels of access, users and passwords in the same table, can anyone provide an overview on how to handle this?

    > I do not understand the recordset has to do with the newspaper to the user.

    Yes, I have just answered the same time-I got deceived to have first to create the Recordset. Your version of MySQL does support the views?

  • Workshop SQL-&gt; Tables-&gt; create the Lookup Table

    It is perhaps a SQL issue rather than an issue of Apex, but...

    With my experience of amateur to create database tables, I usually start with a parent table and create children and link them.

    While playing with Apex, I have the ability to create a Lookup Table of in any table.

    And, what is created is a new table that is, indeed, a parent.
    So I have been working from the bottom to the top.

    I understand that correctly?

    Thank you-
    Marion

    Marion...

    Yes...

    Lookup tables store data from reference and a link to your main table with a standard primary/foreign key relationship.

    This feature is particularly useful if you are creating your tables of data in the worksheet and you want to standardize it.
    Gus...

  • Is it possible for 2 + Firefox Sync accounts use the same e-mail address?

    I have two Windows accounts, each with its own different Firefox profiles, (with 'match' accounts and profiles on other devices on my LAN) and therefore need to implement synchronization for each. Ideally, I would use the email the same for both accounts Sync - naturally with different passwords. Is this possible?

    No, the email address is the "username" on behalf of synchronization, you need a different email address for each synchronization account that you are configuring.

  • HP Envy 17: portable lockout... can't login to my account using the login screen

    This is a brand new HP Envy, I had nothing but software problems, first windows 10 which he is responsible with and now this.

    This morning, HP has uploaded a new bios update. After a reboot in the name of account in the form it does not accept my password. There is no place for a PIN or fingerprint sigon either, only the password.  I know that it is the correct password because I wrote it down.

    I'm stuck on the computer. With the help of a computer laptop back to write this.

    Please HELP, I use this for a home business.

    Since it is a Windows password, I'll give you the same suggestion that Microsoft and HP are likely to give you.

    Remove the hard drive and put it in a drive enclosure hard usb.

    Connect it to another PC of Windows and copy all the important files on an external storage device.

    Once this is done, you can use the recovery media that you must have created by now to find your laptop to the factory delivered State in which it was when you removed from the box.

    Once you have done this, you should make sure that the HP download options are on install only when you want. Alternatively, you can stop Windows 10 update if you wish.  This should prevent your being in this situation once again.

    HP didn't download anything on your PC. You allowed the download occurs allowing the setting to be "automatically download and install updates". In other words, as you now know, not always such a great idea.

  • Can't receive mail from Hotmail account using the phone or windows live mail

    Hello

    I'm having a problem where I get a sign in error whenever I try to access my Hotmail account using my smartphone or windows live mail.

    I CAN however use my web browser to connect and access the account in this way.

    I tried using 2 different laptops (windows 7 on both) and my android phone.

    I have reset the password twice and still have no chance to access the account outside the approach of above web browser.

    It seems that this problem has affected my direct mail phone and windows at the same time, and I am at a loss for a line of conduct.

    Does anyone have a solution?

    Thanks in advance

    It seems that if you have activated the two-step verification when you changed your
    password. If you did, you can not use this password to authenticate in stupid
    programs like Windows Live Mail which cannot ask or submit to security codes. You
    need to generate a unique password app to use in situations like this.

Maybe you are looking for

  • How can I reset the new tab page? (Browser hijacking)

    My browser has been hijacked recently by Trovi search engine, and it changed the home page and the new tab page. I was able to restore the home page, but the new tab page was more complicated. I tried to go to about: config and replacing 'browser.new

  • CORRECT DIRECTORY STRUCTURE

    I thought it would be a simple question, but I guess that's not as I was unable to find an answer to anywhere - of course I can be the question incorrectly.  What is the structure of correct directory of iTunes 12 Win 10 running on an external drive?

  • Is it possible to keep a file to be found by keyword search

    Is it possible to keep a file to be found by keyword search

  • How to find whether the application is running or not?

    Hi guys,. I have 2 requests name such as appln1 and appln2 First I started the appln1 manually (not launched from lettering to the other... here may be getting correct status) then I started the appln2 manually, it must get the current state, if appl

  • APEX 5.0. With the image stored in a BLOB gives ORA-06502.

    HelloI want to create an interactive report - computer desk with an image that is stored in a BLOB but it a: returnes ORA-06502: PL/SQL: digital or value error: character of number conversion error.I created a test with only the image report (charged