A quick query wanted

I have a view with columns and data like:
UNIT STATUS CASES
001 complete 38
001 on-going 32
001 total 70
002 complete 10
002 on-going 47
002 total 57
Can anyone give me a quick query to make the report as:
UNIT Comlete on-going total cases
001 38 32 70
002 10 47 57
Thanks

SQL> -- generating sample data:
SQL> with t as (
  2  select '001' unit, 'complete' status, 38 cases from dual union all
  3  select '001', 'on-going', 32 from dual union all
  4  select '001', 'total', 70 from dual union all
  5  select '002', 'complete', 10 from dual union all
  6  select '002', 'on-going', 47 from dual union all
  7  select '002', 'total', 57  from dual
  8  )
  9  --
10  -- actual query:
11  --
12  select unit
13  ,      max(case when status = 'complete' then cases end ) "complete"
14  ,      max(case when status = 'on-going' then cases end) "on-going"
15  ,      max(case when status = 'total' then cases end) "total"
16  from   t
17  group by unit
18  order by unit;
UNI   complete   on-going      total
001         38         32         70
002         10         47         57
2 rows selected.

Similar Messages

  • How to customize quick query to search with SQL in contain keyword

    I want to build simple query using quick query component. But it will search with SQL equal keyword. How can I customize it to use contain keyword instead. That means, I enter 'sc' to return 'scott'.

    Not sure if the technique described here http://tompeez.wordpress.com/2011/08/21/extending-viewcriteria-to-use-sql-contains-4/ can be used for quick query, but you can try ...
    Timo

  • Quick query component without dropdown

    Hi,
    I am using quickquery component on ADF Tree table .. I want to display quick query without the dropdown in its layout..I want to display only Label, InputText and search button.
    how can I achieve this?
    Thanks,
    Swathi

    Hi,
    Check
    http://blog.applegrew.com/2012/02/adf-super-code-snippets/

  • How to implement Quick Query and Saved Searches in ADF?

    We are using 11gR2 ADF.
    The requirement is to enable Quick Search and save the Searches.
    In the Oracle ADF documentation, it is mentioned that
    - Create a view with view criteria named.
    - In the .jspx drag and drop the view criteria and Select Quick Query
    Upon doing the above, we see that a Search panel is getting created, but with a message 'No Search Fields Added'.
    In the named view criteria, Under 'UI Hints' we have set
    -- execution mode as Both
    -- Search region mode is Basic
    -- Show Operators in Basic
    Under 'Criteria Definition'
    the attributes are added in a group with OR condition.
    Thanks for your reply. Oracle ADF developer guide does not help!!
    If you have any other documentation that helps in implementing this Quick Query and Saved Search, your help is greatly appreciated.

    Set the following on your af:query component
    SaveQueryMode = hidden
    ModeChangeVisible = false
    This should work for you ..
    Regards,

  • Oracle ADF - Refresh quick query for a table in the pop up.

    Hi,
    I am using Oracle jDev 11.1.1.4.0
    In my application I have a Find button in jspx.
    Onclick of Find button, a popup opens.
    When I search for a record by name in QuickQuery, suppose - I entered name as jon.
    It gives me the correct result.
    Now when I close the pop up and again click on Find button, that previous search remains as it is in the pop up
    and also the previous criteria in quick query search region as "jon".
    I have changed the refresh property of iterator(of table in popup) in pageDef
    But still not working...
    How to refresh that search region for every subsequent Find click.
    Appreciate your help.
    Thanks,
    Madhav

    do u changed refresh > ifneeded or always.
    user.
    r u luking for partially page rendering.
    by using ppr. we can refresh.
    if so.
    http://www.adftips.com/2010/10/adf-ui-refreshing-page-or-region.html
    http://biemond.blogspot.com/2007/11/how-to-refresh-region-in-jdeveloper-11g.html
    Re: ADF Region Interaction
    Edited by: Erp on Sep 27, 2011 4:37 AM
    Edited by: Erp on Sep 27, 2011 4:42 AM

  • Using quick query component

    hi,
    I am using quick query component. There is any way to show in the combo box of the quick query component only some and not all fields, because I do not need to display all.
    Please..

    Vane,
    If you're using ADF Business Components - I believe you can do this by creating a named view criteria on your View Object and then dragging-and-dropping the named view criteria on to the page as an af:quickQuery - haven't tested this personally, though.
    A really quick test - no more time today - seems to show that named view criteria can create an af:query, but I didn't see af:quickQuery as an option...
    Time to read the Fusion Developer's Guide, I guess.
    John

  • How to create quick query region?

    Hi,
    How to create quick query region?
    I have got some tip from OAF developer guild:
    OAPageLayoutBean pageLayout = pageContext.getPageLayout();
    pageLayout.setQuickSearch(quickSearchRN);
    But I don't know how to create 'quickSearchRN'.
    So, I try to create a stacklayout region as quickSearchRN, and add it into pageLayout.
    But there are two stacklayout region displayed. One in qucik query region, other in main region.
    please give me some sample code.

    OAFlowLayoutBean quickQueryRN = (OAFlowLayoutBean)createWebBean
    (pageContext,OAWebBeanConstants.FLOW_LAYOUT_BEAN, null, "QuickQueryRN");
    OAMessageTextInputBean condition = (OAMessageTextInputBean)createWebBean
    (pageContext,OAWebBeanConstants.MESSAGE_TEXT_INPUT_BEAN, null, "condition");
    condition.setPrompt("Name");
    quickQueryRN.addIndexedChild(condition);
    pageLayout.setQuickSearch(quickQueryRN);

  • Quick query

    hello there. just a quick query on SQL. I have 4 simple tables in a spatial database each with one geometry column called geom. each table has a different number of tuples in it, i.e.
    city_table has 195 point geometries
    county_table has 3230 polygon/multipolygon geometries
    state_table has 56 polygon/multipolygon geometries
    roads_table has 239 linestring/multilinestring geometries.
    Is there a single SQL command that one can use to retrieve all the data from the geometry column of all tables?
    e.g. Select a1.geom, a2.geom, a3.geom, a4.geom from city_table a1, county_table a2 ...
    Or is it a case of sending 4 individual select statements, one to each table, to retrieve the geometries from that table?

    Joe:
    I would assume that each of the 195 cities is in one of the 3230 counties. The county_id column would contain the id from the county table for the appropriate county.
    In my neck of the woods, the City of Kitchener (say city_id 123) is in Waterloo County (say county_id 2950). So, the cities table record would look like:
    city_id 123
    city_name Kitchener
    county_id 2950
    and the counties table like:
    county_id 2950
    county_name Waterloo
    So, I coulr query:
    SELECT c.city_id, c.city_name, cn.county_name
    FROM cities c, counties cn
    WHERE c.county_id = cn.county_id and
          c.city_id = 123
    and get
    123     Kitchener     WaterlooHTH
    John

  • Dashboard quick query limit component

    Hi All,
    I am using quick query limit in a dashboard...
    I set it up ok in the ESM file... everything is working as advertised, BUT when I create the runtime version everything from the component disappear... the query panel button in the other frames is missing , the runtime dashboard doesn't start from the query panel even if it's defined in the dashboard properties as the startup frame...
    I tried to build the runtime version from the quick query limit sample and I noticed the same behaviour, there is some hidden flags in building the runtime version?
    I'm using version 9.3.1.0.0.248 on Vista
    TIA & best wishes
    Gianluca

    Hi,
    Check
    http://blog.applegrew.com/2012/02/adf-super-code-snippets/

  • ABAP Query - Want to limit the number of records to 5

    I have a query based on a a table join (MKPF with MSEG) infoset. I want to limit the number of records to first five.
    How to deal with it?

    select data from tables using join and where conditions....into internal table....
    now move the first 5 records to second internal table and use them...
    or else in ur select statement u can use...
    select  data from tables <join condition> upto 5 rows.
    Message was edited by:
            Ramesh Babu Chirumamilla

  • Af:Quick Query to af:query

    Hi!!
    I am using jdeveloper 11.1.1.5
    I had created a my viewCriteria GlHdViewCriteria in my VO
    I had dragged and dropped it as a af:queryPanel. I had also dragged and dropped a af:quickQuery Panel to my jspx page and enabled the advance button such that if the user clicks the button it navigates from af:quickQuery Panel to af:query panel
    Hers is my Jspx code
    <af:query id="qryId1" headerText="Search" disclosed="true"
                          value="#{bindings.GlJrnlHdViewCriteriaQuery.queryDescriptor}"
                          model="#{bindings.GlJrnlHdViewCriteriaQuery.queryModel}"
                          queryListener="#{bindings.GlJrnlHdViewCriteriaQuery.processQuery}"
                          queryOperationListener="#{bindings.GlJrnlHdViewCriteriaQuery.processQueryOperation}"
                          binding="#{backingBeanScope.backing_QuickQuery.qryId1}"
                          rendered="#{backingBeanScope.backing_QuickQuery.queryVisible}">
                          <f:facet name="toolbar">
                    <af:commandButton text="Quick"
                                      binding="#{backingBeanScope.backing_QuickQuery.cb5}"
                                      id="cb5"
                                      actionListener="#{backingBeanScope.backing_QuickQuery.advanced2Quick}"/>
                                      </f:facet>
                                      </af:query>
      <af:quickQuery label="Search"
            value="#{bindings.GlJrnlHdViewCriteriaQuery.queryDescriptor}"
                          model="#{bindings.GlJrnlHdViewCriteriaQuery.queryModel}"
                          queryListener="#{bindings.GlJrnlHdViewCriteriaQuery.processQuery}"
                          queryOperationListener="#{bindings.GlJrnlHdViewCriteriaQuery.processQueryOperation}"
                           binding="#{backingBeanScope.backing_QuickQuery.qq1}"
                           id="qq1"
                           rendered="#{backingBeanScope.backing_QuickQuery.quickQueryVisible}">
              <f:facet name="end">
                <af:commandLink text="Advanced" visible="true"
                                binding="#{backingBeanScope.backing_QuickQuery.cl1}"
                                id="cl1"
                                actionListener="#{backingBeanScope.backing_QuickQuery.quick2Advanced}"/>
              </f:facet>
            </af:quickQuery>This was the code i had used in my ManagedBean
         public boolean isQuickQueryVisible()
             return _quickQueryVisible;
           public boolean isQueryVisible()
             return !_quickQueryVisible;
           public String getVisibleComponent()
             if(_quickQueryVisible)
               return "quick";
             else
               return "advanced";
         private boolean _quickQueryVisible = true;
        public void quick2Advanced(javax.faces.event.ActionEvent actionEvent) {
              _quickQueryVisible = !_quickQueryVisible;
        public void advanced2Quick(javax.faces.event.ActionEvent actionEvent) {
              _quickQueryVisible = !_quickQueryVisible;
        }My Scenario is if i perform search operation in af:quickQuery it was successfull in tis operation
    But once i navigate from af:quickQuery to af:query it doent performs the search operation., It was simply idle!!
    I had posted tis in my previous Thread I had lost that thread so i am reposting!!!! !!!
    I apologise for reposting the thread

    Could any body pls hlp me as i am struggling over with this problem

  • Sales Opportunity Contact Person showing numeric in query & want full name

    Hi,
    I have two sql queries as under :
    SELECT T0.OpprId,T0.OpenDate,  T0.Name, T0.Territory, T1.descript, T0.CardCode, T0.CardName,   T0.U_eqno, T2.Name FROM [dbo].[OOPR]  T0 INNER JOIN [dbo].[OTER]  T1 ON T0.Territory = T1.territryID INNER JOIN OCPR T2 ON T0.CprCode = T2.CntctCode
    In the above query the problem is that I want that the Contact Person name which is selected in the sales opportunity to come. But by which query it is only showing those opportunities in which Contact person is there and NOT showing the ones in which Contact person is not there.
    and the second query
    SELECT T0.OpprId,T0.OpenDate,  T0.Name, T0.Territory, T1.descript, T0.CardCode, T0.CardName, T0.CprCode,   T0.U_eqno FROM [dbo].[OOPR]  T0 INNER JOIN [dbo].[OTER]  T1 ON T0.Territory = T1.territryID
    Its showing the Contact person code but I want the name of the contcat person as avaliable in the sales opprtunity.
    I want result in which the above details come along with the Contact person name. Where I am getting wrong in the query....Please help.
    Regards,
    Kamlesh Gupta

    For Your Second Query, use the following Code that Displays both
    Contact person code and Name
    SELECT T0.OpprId,T0.OpenDate, T0.Name, T0.Territory, T1.descript, T0.CardCode, T0.CardName,T0.CprCode, (Select T1.Name from OCPR t1 where t1.cntctCODE=T0.CprCode),T0.U_eqno  FROM dbo.OOPR T0
    INNER JOIN dbo.OTER T1 ON T0.Territory = T1.territryID

  • SAP query , want a new calculation

    Hi,
    I have a SAP query which displays the material quantity , shipping instructions etc.
    what i want is not a new field or column, but just display at the end of the shipping instructions column 2 lines showing the ratios of 2 values.
    How do i do this? I know to add additional columns but how am i to add just 2 rows with custom calculations?

    Hi,
    In SQ02, you hae the option to add your own code lines. You will find this icon in the toolbar after teh 'Extras' button.
    You can write the code in any event that you wish. Check the node where you are writing this code.
    Regards,
    Subramanian

  • Quick Query Variable Question

    What variable would column headings/names be kept in? I'm
    outputting a query into a seperate structure and want the seperate
    structure keys to be the same as the column heading in the original
    query. The variable I'm looking for is #QueryColumn# in the code
    below.

    queryName.columnlist should allow you to do this.
    <cfloop query="queryName">
    <cfloop list="#queryName.columnList#" index="colName">
    <cfset structure[colName][currentRow] =
    queryName[colName][currentRow]>
    </cfloop>
    </cfloop>
    hukadeeze wrote:
    > What variable would column headings/names be kept in?
    I'm outputting a query
    > into a seperate structure and want the seperate
    structure keys to be the same
    > as the column heading in the original query. The
    variable I'm looking for is
    > #QueryColumn# in the code below.
    >
    >
    >
    > <cfset Structure = StructNew()>
    >
    > <cfoutput query="QueryName">
    > <cfset Structure.#QueryColumn# =
    #QueryColumnValue#>
    > </cfoutput>
    >

  • Quick query about speed

    Hi there,
    I couldn't find another thread where this would really be suitable, so I thought i'd just make a thread in hopes of a quick answer.
    When on Infinity 1, i was synced at the max available which was 37, but download speeds were always 4.4MB/s - I'm sure many of you enjoyed the same.
    I've opted for the upgrade to 76/19, and it was activated today. The speed may well change again, but for now my ip profile is set to 65ish - however my download speeds are at 7.9MB/s.
    What would the speeds be if I was synced at the max available, just out of curiosity?
    Thanks 

    I get about 9.8Mbit/s maxed out on an 80meg sync line with a profile of 77.6meg.
    Occasionally clips 10. This is using newsgroups.
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the the reply answers your question then please mark as ’Mark as Accepted Solution’

Maybe you are looking for

  • Food for thought : Closing I/O streams ....

    hi all, my intention is to release all the I/O streams after i have finished their use .to do it i call the .Close() method in a finally block . my question is : how is calling .Close() on an I/O stream different from, assigning a null to it . i.e. :

  • Where are the tables?

    I have looked everywhere so I assume tables are not an option in iWeb. That seems like such an obvious tool to include and would provide such nice integration with spreadsheets from Numbers and tables from Pages. ...or am I missing something.

  • [b]Keep getting java.lang.OutOfMemoryError.....SOMEONE HELP!!!![/b][/b]

    I am currently writing code for a database software using Joins, Collections, Vectors, etc. and when running the code I keep getting a java.lang.OutOfMemoryError. The thing is that I have a parser that parses through different XML files and Java file

  • What cause an iphone to shutdown and not power up?

    Iphone just shutdown without any reason, phone had a charge and now does not want to power up. its back on a charger but no life.  Does anyone have a fix?

  • Songs just dissapearing

    I have a huge lossless library on my external HD. I have an organised library. Latly strange things happens: 1. Songs wich I know for a fact has been in its folder on the HD: ekst HD>itunes>music>artist>song is gone. It could be track 2,5,6 and 9 of