Is it possible to group by cetain values?

i have an oracle database table with following values
--------------+
| id | Name |
--------------+
| 0 | One |
| 1 | Two |
| 2 | Three|
| 3 | four |
| 4 | One |
| 5 | One |
| 6 |Two |
| 7 | five |
would like to count the number of rows having names 'One','Two',Rest of Names. the result set should be like
--------------+
| name| count |
--------------+
| One | 3 |
| Two | 2 |
| Rest| 3 |
any help,Thanks in advance
-R
Edited by: Mac_ on Apr 26, 2013 12:42 AM

Sorry for wrongly written SQL. Just removed it. Here is the correct one
select name, count(*) from ttt where name in ('one','two')group by name
union
select 'rest',count(*) from ttt where name not in ('one','two')Salman
Edited by: Salman Qureshi on Apr 26, 2013 4:06 PM

Similar Messages

  • Record group/list of values question

    Is it possible to assign one record group/list of values to multiple data items on a canves? If so, how is it done.
    Thanks

    Thanks for the replies..
    What I have is this... I have a db record with 3 currency code fields, three different types of codes, displayed on the canvas. When the user mouse's over to any of the currency code fields, I wanted the lov to pop up and the user pick one of the selections. The lov has 2 columns, country and currency
    Ex: France | Euro
    U.S. | Dol
    I built this as a static record group. If I'm in the second currency code field and pick a value, the first currency code field gets overlayed with the new value.

  • Fbl5n profit center is cracked   , itz possible to get profit center value

    fbl5n profit center is cracked u  , itz possible to get profit center value
    in ur zfbl5n report
    der r few changes in program to b made
    Message was edited by:
            Ronei Shedi

    Hello Ronei,
    No need to make a copy of the FBL5N to have the profit center in the list.
    You can have it in the ALV Layout.
    Select profit center in the Hidden fields column and pass it to left hand side column.
    Save as a Display Variant.
    Next time when you run the FBL5N, select your display variant in the last frame "List Output".
    Regards,
    Naimesh Patel

  • Possible to supply a hex value to solid's color property?

    I know the AE Scripting Guide specifies that we have to supply an array of RGB values if we wish to change a solid's color property.  I'm just curious if it is possible to supply a hex value in lieu of an RGB array.  Does anybody have any experience with a work around?
    Thanks!

    Dan,
    Just wanted to add that I didn't realize your function assumed the hex color value would be passed in as `0xFFFFFF`.  My data was passed in as a string such as `FFFFFF`.  To fix, I just added one line:
    function hexToColor(theHex){
      theHex = parseInt(theHex,16);
      var r = theHex >> 16;
      var g = (theHex & 0x00ff00) >> 8;
      var b = theHex & 0xff;
      return [r/255,g/255,b/255];
    Thought this might help somebody who had the same data coming in question.  Thanks, again for the help.

  • Is it possible to assign a default value to an out parameter??

    Is it possible to assign a default value to an out parameter??
    Thanks in advance.

    pradeep.vupala wrote:
    I think ur looking for an IN OUT parameter?That won't help.
    A quick test is easy to check what happens :
    SQL> create or replace procedure myproc(p_out out number default 1)
      2  as
      3  begin
      4  null;
      5  end;
      6  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE MYPROC:
    LINE/COL ERROR
    1/18     PLS-00230: OUT and IN OUT formal parameters may not have default expressions
    SQL> create or replace procedure myproc(p_out in out number default 1)
      2  as
      3  begin
      4  null;
      5  end;
      6  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE MYPROC:
    LINE/COL ERROR
    1/18     PLS-00230: OUT and IN OUT formal parameters may not have default expressions
    SQL>

  • Is it possible to group 2 objects that are located on 2 different pages in InDesign CS4 JS

    Is it possible to group 2 objects that are located on 2 different pages. Would it be something like that:
            var myArray = new Array;
            //Add the items to the array.
            myArray.push(myLine1);
            myArray.push(myLine2);
            //Group the items.
            var myPages = app.activeDocument.pages;
            myGroup = myPage.groups.add(myArray);
    Thank you very much for your help.
    Yulia

    You can group objects from distinct pages only if they belong to the same spread.
    For instance, if you have a rectangle on page 2 and a rectangle on page 3 in a "facing pages" configuration, this should work:
    var doc = app.activeDocument;
    var r2 = doc.pages[1].rectangles[0]; // rectangle on page 2
    var r3 = doc.pages[2].rectangles[0]; // rectangle on page 3
    // it's better here to handle the parent spread:
    var g = doc.spreads[1].groups.add([r2,r3]);
    // but this may also work:
    // var g = doc.pages[1].groups.add([r2,r3]);
    // var g = doc.pages[2].groups.add([r2,r3]);
    @+
    Marc

  • Is it possible to insert a table value in query output?

    Hi,
    I am developing a query in which i have to display is a few values from a table in the output. I want to know if it is possible to directly get the values from the table thru the user exit and display in output or should i first put the values of the table into a infoprovider and get it from there in the query?
    Regards,
    Sujai

    Hi Sujai,
    You will have to put the values from the table into an infoProvider and then create a query on that infoProvider. Data from table cannot be directly shown in a query.
    Hope that helps!
    Regards,
    Saurabh

  • Is it possible to get the total value for column and assign to other field

    hi,
    Is it possible to get the total value of particular column and assign that value to another field?
    How to do this?
    Thanks in advance,
    SAN

    Afridi,
    My extended controller class code:
    package xxhr.oracle.apps.per.selfservice.appraisals.webui;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import oracle.apps.per.selfservice.appraisals.webui.OverviewPageCO;
    import oracle.jbo.Row;
    public class XXOverviewPageCO extends OverviewPageCO {
    public XXOverviewPageCO() {
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("XXCalcAvgButton")!=null){
    throw new OAException("welcome",OAException.INFORMATION);
    //getSum(pageContext, webBean);
    private String getSum(OAPageContext pageContext, OAWebBean webBean) {
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject ratvo = (OAViewObject)am.findViewObject("CompetenceElementsVO");
    OAViewObject valuevo = (OAViewObject)am.findViewObject("PerRatingLevelsVO");
    Integer Sum = new Integer("0");
    int numofRows = ratvo.getRowCount();
    for (int x = 0; x < numofRows; x++) {
    Object Rating =
    ratvo.getRowAtRangeIndex(x).getAttribute("ProficiencyLevelId");
    if(Rating!=null) {
    int numofRowsforvalue = valuevo.getRowCount();
    for(int i=0;i<numofRowsforvalue;i++){
    if(valuevo.getRowAtRangeIndex(i).getAttribute("RatingLevelId").equals(Rating)){
    Object StepValue=valuevo.getRowAtRangeIndex(i).getAttribute("StepValue");
    Sum = new Integer(StepValue.toString()) + Sum;
    OAMessageStyledTextBean displayCompAvg=(OAMessageStyledTextBean)webBean.findChildRecursive("XXCompAvgText");
    displayCompAvg.setValue(pageContext,Sum);
    return null;
    But it is not affecting in the page.
    Can you please tell me what is the problem.

  • Sorting and Grouping by multi-value Choice columns - any options?

    I found out the hard way that SharePoint doesn't support sorting or grouping lists by Choice columns that are set to "Allow Multiple Values." I'm stunned by this missing capability, and my project has come to a complete halt without it. It's like Microsoft only implemented hafl the feature -- you can put data in, but then you can't do anything with it. You can't even use the column in a formula in another column, so you can't parse it.
    I'm not posting just to gripe though. Does anyone have any suggestions for alternatives? What do you do when you need to let people make multiple selections, and then you want to sort or group by those values? Are there any add-on products that allow this? At this point my only option seems to be to not allow multiple choices, but that's taking away a rather significant feature.
    Thanks for any ideas,
    Steve

    Hi Paul,
    Thank you for the reply and the additional questions. For my situation I want to use the multi-value choice to indicate a "belongs to" relationship, as in "this item belongs to projectA, projectB, and project C. Because there are more than 10 projects, I didn't want to create a separate Yes/No checkbox for each one.
    For viewing the information, I'm looking primarily for a "group by" function.  So if an item belongs to projectA, projectB, and projectC, it would appear three times, once under the grouping for each project. What I don't want is for a row that only belongs to projectA to be grouped separately from a row that belongs to both projectA and projectB. I want to see all the rows that belong to projectA grouped together, regardless of whether they also belong to other projects.
    I'll look into using a grid control, but if you have any other suggestions I'll certainly listen.
    Steve

  • Is it possible to lock a single value in a table

    is it possible to lock a single value in a table ?
    please suggest me the best possible ways to do so
    thanks in advance
    Nkbhatt

    HI,
    You can lock a Single reocrd also, you need to create the Lock object first form SE11, then follow the below link, you will get your answer
    http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm
    Regards
    Sudheer

  • Is it possible to pass the property value dynamically to composite.xml

    Hi,
    Is it possible to pass the property value dynamically to composite.xml from bpel?
    For ex:
    <property name="bpel.config.auditLevel">$variable</property>
    I will get a different $variable value every time to bpel.
    Also, when I included the following code inside .bpel
    invoke name="InvokeListFileFTPAdapter-ListFiles"
    partnerLink="ListFilesFTPAdapter"
    portType="ns3:FileListing_ptt" operation="FileListing"
    inputVariable="listfilesRequest"
    outputVariable="listfilesResponse" bpelx:invokeAsDetail="no">
    <bpelx:toProperties>
    <bpelx:toProperty name="bpel.auditLevel"
    variable="AuditVariable"/>
    </bpelx:toProperties>
    </invoke>
    where auditvariable='Off'
    I don't see any change in em. The invoke activity is showing full payload, Can't we turn off the audit level from .bpel not from composite.xml

    Hi,
    You can use bpel preferences for that:
    1.
    In the composite add a property, for ex:
    <component name="test">
    <implementation.bpel src="test.bpel"/>
    <property name="bpel.preference.exam">abc</property>
    </component>
    2.
    To get the value within your bpel process use: ora:getPreference(exam)
    3.
    Then, you can change the value in the EM:
    Under Farm_soa_domain>weblogic domain>your_domain>soa_server1
    Right click on menu>system Mbean browser>oracle.soa.config>server:soa_server1>SCAComposite>your project>SCAComposite.SCAComponent>processName>
    Now, click on the properties attribute : you can see the exam property and change the value.
    Arik

  • Is it possible to pass a null value to a method?

    is it possible to pass a null value to a method?
    like this
    public String getParameterXX(String testvalue)
    String strX = "whatever";
    if(testvalue!=null)
    strX = strX + " man " ;
    Is this possible ?
    is this legal
    String i = getParameterXX(null);

    I also ran a similar code using null in a method, it just considers null as another string and concatenates it so
    public String getParameterXX(String testvalue)
    String strX = testvalue+"whatever";
    return strX;
    public static void main(String [] args)
    Test tt = new Test();
    String i = tt.getParameterXX(null);
    System.out.println(i);
    Gives me "nullwhatever"

  • Is it possible to pass table type values as input parameter for con prg?

    Hi All,
    Could you please confirm that is it possible to pass table type value as input to concurrent program?
    If possible how to achive this?
    If not possible whether we have any ora doc which is confirming this.
    Any hel will be great.
    Thanks,

    Hi student;
    Please check (http://apps2fusion.com/at/45-as/241-enablingdisabling-concurrent-program-parameters)
    Hope it helps
    Regard
    Helios

  • Editing not possible because 'Request flag' has value X

    When i try to change an number range settings from number range administration, i get an error "Editing not possible because 'Request flag' has value X "
    how can and  where can i remove this flag from?
    Thanks

    Hi Tuncer,
                   I am not aware about the GUI table interface through which you can change the flag.
    But i guess there is an option
    Go to transaction se11 --> write /AIN* in the table name field.
    You will find all the table names related to SAP AII. In the search list now available to you, search for the word "Number".
    Then you will find all the table names related to number ranges.
    Here you can search the table which will be having that flag field. If you find this table,
    go into that table and make that entry manually.
    Here is what i can suggest you immediately to solve your problem
    please rvrt for other questions.

  • Group Asset  Takeover Value

    Dear,
    Is there any table entry for group asset takeover value ?..
    When i am using AS82 for creating group asset after that click on Takeover value then that field comes in grayed..
    Regards,
    Kaushal Shah

    Hi,
    Check out the depreciation area screen layout and not asset master screen layout. Check out your Configuration fro group assets at the depreciation area level.
    Thanks,
    Sujai

Maybe you are looking for

  • IPod not recognized by iTunes after multiple restorations...

    It appears that I'm not the only one getting the problem where iTunes tells you to restore the iPod touch multiple times and then stops recognizing that the iPod is not connected. The iPod itself is not responding to the restoration. Once the restora

  • Use of Tokens in Authorization Management Tool

    Hello, In Mobile Sales (5.0), I'm trying to restrict users from changing data of BP's with an specific Account Group. This means, the sales rep should have only read-access to BP's with Account Group = "001", but read, write and modify access to BP's

  • For the property PollingStatement issue in WCF-SQL adapter

    Why i am getting below errors and finally receive port is disabled . Configured WC_SQl properties : In General tab: InBoundID=PODepartment IntialCatalog:Test Server: . First error : The Messaging Engine failed to add a receive location "RL_WCFCustome

  • Test Restore Of Backup On Seperate Host

    I want to test my backup by restoring the full backup of my production database on a seperate test host.All my RMAN backup's are at primary side on a disk.My doubt here is when i issue restore backup command at test host how rman recoginzes the backu

  • Missing file in Mailboxes

    Changed password to email and now I can't find my "Notes" file. How do I get it back?