Counting items in a view

Hi all,
I have the following problem:
I have a table containing document data, each document has a doc_id as a unique indentifier. Each document is assigned to a project via the column proj_code:
CREATE TABLE DOCS
DOC_ID NUMBER(22) NULL,
PROJ_CODE VARCHAR2(10) NULL,
In another table I have the project codes, project names and customer names. Each project has one customer assigned to it, there can be multiple projects per customer. Project code and project name are in a 1:1 relationship:
CREATE TABLE PROJECT
PROJ_CODE NUMBER(22) NULL,
CUST_NAME VARCHAR2(30) NULL,
PROJ_NAME VARCHAR2(30) NULL
What I'm trying to do now is construct a view, that'll give me project code, project name, customer name and the count of documents, that have this project code. here's what I've come up with so far:
select proj_code, count(doc_id) from
(select project.proj_code, doc_id from project, docs where project.proj_code = docs.proj_code) group by proj_code;
This has two problems: it does not show the projects, that have no documents. Also, if I add the other columns to the select clause, I get this error:
ORA-00979: not a GROUP BY expression [SQL State=42000, DB Errorcode=979]
Ideas, anyone?
Thanks,
Mike

(+) is an Oracle specific way of signifying outer
joins. Since 9i Oracle has supported the ANSI
constructs LEFT OUTER and RIGHT OUTER, it's just that
old dogs such as myself tend to use (+) out of sheer
force of habit.I stick with the old syntax as to me left and right are totally confusing concepts when it comes to sets, and the new syntax is as verbose as anything you'd expect to be designed by a committee.
The big advanatge of the ANSI
version is that it also has FULL OUTER, which was
rather inconvenient to do in the earlier versions of
Oracle.Agreed. Though I've only ever written precisely one full outer join, and seen one other.

Similar Messages

  • How would I count items in DataSet2 and have them grouped by the column that is tied to DataSet1?

    Greetings!
    First, thank you for looking at my question. I am trying to count the number of items that = "True" in DataSet2 and display them in the "Week" column in a table who is pointed to DataSet1.
    I have a simple table that is set up something like this:
    CDC Week |
    [Week Number] from DataSet1
    | Total
    Count of Some Item |
    [CountSomeField] from DataSet1
    | [ Total of Row]
    Count of Another Item | 
    [CountOfTrueItems] from DataSet2
    | [Total of Row]
    With the expected results:
    CDC Week |
    25
    | 26 |
    27 |
    (n/a)
    Count of Some Item |
    10 |
    20 |
    30 |
    (Expected 60 but not working yet)
    Count of Another Item |
    5 |
    10 |
    15 |
    (Expected 30 but not working yet)
    Instead I get:
    CDC Week |
    25 |
    26 |
    27 | 
    (n/a)
    Count of Some Item |
    10 |
    20 |
    30 |
    (Not working yet)
    Count of Another Item |
    30 |
    30 |
    30 |
    (Not working yet)
    DataSet1 has a few columns including a "Week" column. DataSet2 has two columns, "WEEK" and "POS".
    I need to count items when POS = "TRUE" in DataSet2 and group them on the "Week" column.
    My current expression is =SUM(IIF(Fields!Pos_.Value = "True", 1, 0), "DataSet2")
    And while this returns a value, it does not count (or sum) by each week. I am missing something...
    Thank you for any assistance!
    p.s. Sorry My html skills are not shining with the table formatting :(

    Hi,
    Would you please provide some screenshots?
    Work hard, play harder!

  • Item Assignment to View Error

    Dear Experts,
    We are using SRM5.0 with CCM2.0 and when I tried to assign items to view for procurement catalog's by selecting the category,receiving error message as "select atleast one row",please advice me on the same to resolve this error.
    Best Regards,
    Venkata Koppisetti.

    Hi Venkata,
    Once you navigate through the categories you will be presented with items within these categories on the right hand 'Items' frame, you need to select the items you wish to present in the view from here and once marked/selected choose the 'Assign' button which will assign those selected items to the view. It is not possible to assign a category to a view, if you want all items within a category assigned to the view choose the table menu selection 'Slect All' and assign, then all items in this open category will be assigned to the view.
    Regards
    Jason

  • Publication Item on a VIEW

    Hi,
    Here is my problem :
    I have a table A in the schema A.
    In another schema, schema B, I have a view (VIEW B) based on the table A .
    My application schema for Olite is schema C. I want all my CEQ$ and CVR$ and CLG$ ables to be in schema C. I created a synonym on the view B in the schema C. When I create a publication Item based on this synonym, I cannot create a hint on the Publication Item because Olite say to me that the base table and the view must be in the same database.
    After that, I tried to create a publication item base on the VIEW B in the schema B and a publication Item based on Table A in the Schema A On the publication item based on the view, I created a hint to match the primary Key in table A. When I create a publication with these 2 new Publication Items, it works but when i try to instantiate the publication for a user, Olite don't want to instantiate the subscription because He don't find the base table (Table A). Also with that manner the CEQ$ and ohter Olite Tables are created In schema B (for publication Item on the view) and schema A (For publication Item based on the table).
    So my question is : How can I create a publication Item based on a view and have all my CEQ% tables in the same schema (Schema C) when the view, the table and the application Schema are three différent Schema.
    I hope you will understand my question.
    Thanks
    JSET

    You wouldn't be able to do that out-of-the-box. Manually updating the triggers and owners, you may be able to accomplish this. But then there are internal metadata you would have to figure out as well. Could get really ugly if you tried some of this. I would not recommend it.

  • Limit on Page-By-Item in Disco Viewer

    Hi There.
    Is there a limit on page by items on Disco Viewer.
    It works fine but as soon as i add more than one page by item no matter the result i select it defaults to <All>
    Regards

    Hi,
    Do you mean that it doesn't filter the data according to the value you selected ?
    I am not aware of a limitation on the page items and for sure you can have more than one.
    Personally I have seen workbooks running under viewer with more than 5 page items.
    What version of viewer do you use? maybe you need to patch it up...

  • Associating a Navigation Item with a View Controller in a XIB

    According to Xcode:
    The 'navigationItem' outlet of a UIViewController has been deprecated. Navigation items are required prior to loading a view controller's view. Instead of an outlet, consider embedding the navigation item in the view controller.
    What does "embedding the navigation item in the view controller" mean? The obvious interpretation of putting a navigation item in the view controller's XIB as a peer to the view has no effect.

    Hi -
       Try using Command "SET_SELECTION_STATE" in dropdown Data Binding - Data Binding type.
    Anesh B

  • Found 0 results for While browsing eBay, when I watch or bid on an item, and later view it again, many inches of white space appears before item appears. If I delete the clear recent history box, the pages will come up as they should for several times, th

    While browsing eBay, when I watch or bid on an item, and later view it again, many inches of white space appears before item appears. If I delete the clear recent history box, the pages will come up as they should for several times, then go back to a lot of extra white space. How can I prevent this? Thank you, Rick in English
    == This happened ==
    Every time Firefox opened
    == About a month ago

    As stated in 1.:
    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve the problem.
    Obviously, it will not harm your computer provided you follow the instructions. However, if you don't post your results in the thread where you were given those instructions, then the person helping you cannot help you further. As he asks at the end, "please post the test results on Pastebin, then post a link here to the page you created."

  • How to remove the item in Did.View .

    Hi,
    How to remove the Work sheet item in Dis.viewer.By using drill to related u can add the item into the worksheet.i want to remove the same...
    Regards
    Manikandan.

    Hi Manikandan
    Just use the back button on the browser. The page will return to the original query. That's the whole point of why Viewer is based on HTML.
    Bets wishes
    Michael

  • OBIEE:Page Items in Table View

    Hi, I m new in obiee
    I m facing problem in adding page items in table view,
    can u please tell me how to add it?
    Thanks,
    Rohit.

    yes, you are right...(Raghu)
    I am creating tabular report where i want to add page section in table view like pivot table....
    thanks,
    waiting for your reply..
    Rohit..
    Edited by: rohitdesai on Feb 5, 2010 2:12 AM
    Edited by: rohitdesai on Feb 5, 2010 2:15 AM

  • AWM 10.2.0.1.0A does not show all items in Object View

    Hi All,
    Is there any known limitation in AWM for displaying items in object view? ( I did a search of the forum and couldn't find anything)
    I have imported and Express 6.3.4 Database, and found that AWM does not display all the programs in its list, however in OLAP Worksheet, LISTNAMES shows the program as present as per normal, and I am able to edit it.
    The program only has 175 lines, so I doubt it has something to do with buffer, however the one I know is missing, just so happens to be the last one in the LISTNAMES program list (alphabetically last)
    Regards,
    Imran

    There was a bug logged for this issue. Thanks

  • Count item in content area

    Is it possible to count all the items (document, URL, zip file, etc) of a Content area? Is there any standard statistic or tool to do this?
    thanks!
    paolo

    hi paolo,
    one way is using the content management view wwsbr_all_items.
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/plsql/doc/pldoc_9026/wwsbr_api.html
    regards,
    christian

  • Ical moving item in week view to next week view - can you drag it

    i like to drag items not completed from a week view to the next week view, but as with Office 2007 you cant just drag the event from the week view to the months calendar view on the side and drop it into a new date.
    I know if you use month view, it make is easy but month view is my least preferred display option, also in month view, to drag to the next month is no possible.
    I wonder what is a quickstep to do this, it must be annoying for others

    CaptainStarwars,
    Try using (⌘+C) and then (⌘+V). That action retains the event in the original, while also placing a duplicate in the new location.
    If you want to remove the event from the original time, use (⌘+X), then (⌘+V) in the new time frame.
    ;~)

  • How to display multiple categories of webapp items in list view? Changing listbox list to checkbox list to select category in submission process?

    Hello!
    1.
    I am trying to get my page to list webapp items that are part of a few categories. I understand that if i want to view only one category, I just need to do the normal process of choosing that category and placing it out. So my question is: How do I display multiple categories of items in a webapp in a single page. I've tried this
    {module_webapps,WEBAPP_ID,c,CATEGORY_ID1,,,,10,,1} {module_webapps,WEBAPP_ID,c,CATEGORY_ID2,,,,10,,1}
    This only displays the everything from the first category, then everything from the next, which will not make it in order of date.
    I've also tried this for fun:
    {module_webapps,WEBAPP_ID,c,CATEGORY_ID1&CATEGORY_ID2,,,,10,,1}
    How can I go about doing it?
    2.
    I am looking to allow users to input a webapp item and allow them to select a category to tie to that item.
    <label for="CAT_Category">Category (You may select more than 1)<span class="req">*</span></label>
        <select name="CAT_Category" id="CAT_Category" class="cat_listbox" rows="4" multiple="multiple" style="height: 60px;">
        <option value="CATEGORY_ID1">--- Option 1</option>
        <option value="CATEGORY_ID2">--- Option 2</option>
        </select>
    Is it possible for me to change the listbox style into a checkbox style such that the user doesn't have to control+click multiple options?

    No answer to No.1 but I really want to find it out too.
    No.2 
    If you already know list of the categories & ID you can manually create a list of checkboxes
    <input type="checkbox" name="CAT_Category" value="89081" />
    <input type="checkbox" name="CAT_Category" value="89082" />
    <input type="checkbox" name="CAT_Category" value="89083" />
    something like that should work

  • ICal does not display all items in month view

    Hi,
    in month view, iCal displays ... to show that some items are not displayed. However, this happens many times when there is ample space to display the item, and even happens when there is only one item!
    Does anybody know how to force iCal to show as many as possible items?
    Thanks...

    Hey, thank you.
    But how do I change the font and its size?
    I tried....
    Thanks,
    Janos

  • Double items in list-view calendar iOS 7

    Since I first opened the calander-app in iOS 7, some, but not all items are shown twice in the list-view, but not in the other views. If I delete one of the doubles, both are gone. It seems to be completely random what items are shown twice. Is it a bug? It happens both with iCloud and Exchange items. Both single and repeating appointments. I can not see any logic in it. Please help, because it makes the list-view very cluttered now...
    Kind regards,
    Piet

    Okay, I don't understand why, but the problem seems to be induced by the update process. Though the other views are unaffected, some (a lot) items in the list-view are being doubled. It seems to be random, but both my iOS devices are affected in exactly the same way, so there must be a mechanism that causes it.
    But... If you turn off the calendars for the affected accounts (iCloud, Exchange), confirm that they are being removed from your device, and then turning them on again, they are being re-synchronized. This creates new entries in the calendar that in the list-view are not doubled anymore.
    Be careful! Do not delete the items manually, since this will delete the item on all synchronized devices. Just turn the calendars off in the account settings and choose not to keep them on your device but remove them from your device instead.
    This will fix the problem quick and easy.
    Kind regards,
    Piet Groeneveld

Maybe you are looking for

  • OLD Apple 22" LCD @ 1600 X1024 On my PC

    Hello I am using an Apple 22" LCD with a Apple DVI to ADC converter on my PC its running off of a GeForce 7800 GS AGP card. The LCD is great. The only problem is that it some times shuts off and will not turn back on again unless if keep it unpluged

  • Parental Control Troubleshooting

    I tried to install the Guest Account and Parental control with few additions in the pre-selected software. As soon as I push the "lock icon" to close the "parental controls", the multicolor wheel do not stop rolling and I have to "force quit" from "p

  • How to open CD that fails to autostart

    Hi. The PC/Mac software that came with my new camera won't autostart on my Mac and I don't know how to start it off the CD. thanks

  • REF CURSOR? FUNCTION RETURN VALUE BASED ON DYN QUERY

    Hi to all, i need to write a function that do the following (but have to work...): Note: what i really don't remember is how can i have a valid cursor based using a dynamic field taken from the input value PAR_NAME. Hope that my problem is clear read

  • Color setting message

    After we started to use script that each time reinforces color settings that are saved on a server, we started to get a message: "The current color settings file has been modified outside of InDesign. Do you want to synchronize..." This message is ir