Get the data with more than one of the desired value

Hi,
I need to pull the records with more than one value of 'Other' on the delivery days fields.
The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
Here is the Sample data:
cust_id: 123
item: newspaper
mon: Home
tue:Work
wed: Other
thu: Home
fri: Other
sat: Other
And here is my query so far.
select
cust_id,
item,
mon,
tue,
wed,
thu,
fri,
sat,
sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
else 0 end) as day_ctr
from customer
Could you please help me with the right formula I need to get this?
Thank you in advance..

First
DESC customer
Second
Can you explain what you are trying with
sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
Third
Usually it's helpful a example of the result you want...
Perhaps you want this
select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
        DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
        DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
        DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
        DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
        DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
select
COUNT(DISTINCT mon) mon,
COUNT(DISTINCT tue) tue,
COUNT(DISTINCT wed) wed,
COUNT(DISTINCT thu) thu,
COUNT(DISTINCT fri) fri,
COUNT(DISTINCT sat ) sat
from customer
)

Similar Messages

  • Get data with more than one table

    hi Gurus,
    I am from ABAP and now am doing Crystal reports...please bear with me if am silly.
    in ABAP I have developed a report based on my select statement.
    ex : **SELECT SINGLE * FROM cabn WHERE atnam EQ 'Z10_OPS_INC_REGION'.**   
           CLEAR ausp_objek.
          CONCATENATE cciht_ihva-recn cciht_ihva-actn INTO ausp_objek.
          CLEAR ausp.
    now i have value in ausp_objek based on this i gone to other table to get the ausp-atwrt
          SELECT DISTINCT atwrt FROM ausp
                                INTO CORRESPONDING FIELDS OF TABLE lt_ausp
                                WHERE objek EQ ausp_objek
                                  AND atinn EQ cabn-atinn
    so i have value in lt_ausp-atwrt which i wanted..
    so in CRYSTAL  How does this work???...i have linked the tables but it is not a direct value from single table...at this point how do we get the desired results...
    hope am clear...
    thank you,
    pasala.

    Hi Pasala,
    Nothing silly about it... We have a forum called SAP integration Kit which is both familiar with ABAP and CR so I moved your post to that forum.
    Try searching on the home page for this forum on "ABAP" and you'll find lots of examples and suggestions and of course others will help too.
    Don

  • When I import a cd with more than one artist iTunes separates each individual artist - how do I get it to show the album as a whole rather than individual artist?

    When I import a cd with more than one artist itunes shows each artist's song separately and won't group the album as a whole - this is incredibly frustrating something that Windows media player doesn't do. Does anyone have a simple cure for this annoyance?

    Generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • Create a logical column with more than one data source

    I'm having a problem to create a logical column with more than one data source in Siebel 7.8.
    What I want to do is the union of 2 physical tables in one logical table.
    For example, I have a "local_clients" table and a "abroad_clients" table. What I want is to have a logical table "clients" with the client data from the 2 tables.
    What I've tried is dragging the datasources I need onto the logical column.
    However this isn't working because it only retrieves the data from the first data source.

    Hi!
    I think it is not possible to do this just by dragging the columns to the logical table. A logical table can have more than one source, but I think each column must have just one direct source column.
    I'm not sure, but maybe you should do the UNION SQL to get the data of the two tables. In the physical layer, when you create a new physical table, it's possible to set the "table type" as a "SELECT". I didn't try that, but it seems that it's possible to have the union table in the physical layer.
    Bye.
    Message was edited by:
    user578388

  • RegionRenderer encodeAll The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance.

    Hi,
    I am using JDEV 11.1.2.1.0
    I am getting the following error :-
    <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    Piece of code is for region is:-
       <f:facet name="second">
                                                <af:panelStretchLayout id="pa1"
                                                                       binding="#{backingBeanScope.Assign.pa1}">
                                                    <f:facet name="center">
                                                        <af:region value="#{bindings.tfdAssignGraph1.regionModel}" id="r1"
                                                                   binding="#{backingBeanScope.Assign.r1}"/>
                                                    </f:facet>
                                                </af:panelStretchLayout>
                                            </f:facet>
    How do I resolve it ?
    Thanks,

    Hi,
    I see at least 3 errors
    1. <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components.
    the page fragment should only have a single component under the jsp:root tag. If you see more than one, wrap them in e.g. an af:panelGroupLayout or af:group component
    2. SAPFunction.jspx/.xml" has an invalid character ".".
    check the document (you can open it in JDeveloper if the customization was a seeded one. Seems that editing this file smething has gone bad
    3. The expression "#{bindings..regionModel}" (that was specified for the RegionModel "value" attribute of the region component with id "pePanel") evaluated to null.
    "pageeditorpanel" does seem to be missing in the PageDef file of the page holding the region
    Frank

  • When texting with more than one person at a time the incoming text scrolls to top of the conversation. anyone out there with the same issue?

    while texting with more than one person at a time the incoming texts scrolls to top of conversation. anyone having this issue?

    I've heard claims it can be done, claims some have done it, and claims that it didn't work for them. This thread is interesting, some indications it should be possible, complaints that it didn't, and also an interesting work-around:
    "How do I text message multiple people at once?"
    http://discussions.apple.com/click.jspa?searchID=-1&messageID=4822260
    You can ask Apple for iPhone changes via this link:
    http://www.apple.com/feedback/iphone.html
    Though if you're requesting hardware changes for iPhone v2 you may want to wait a week (or a month?)...they're probably going to be inundated right now by requests for software changes to the current iPhone.
    (If this has answered your question, please mark your original post as answered)

  • I am using iPhoto 11 mail and cannot add more than one recipient in the 'to' line.  When I put a comma in, the recipient's address is deleted.  If I use ' ' with more than one recipient the save grays out.  Any thoughts?

    am using iPhoto 11 mail and cannot add more than one recipient in the 'to' line.  When I put a comma in, the recipient's address is deleted.  If I use '< >' with more than one recipient the save grays out.  Any thoughts?

    I figured it out.  I needed to fix some errors in my account information.  It works fine now.

  • Error while running spatial queries on a table with more than one geometry.

    Hello,
    I'm using GeoServer with Oracle Spatial database, and this is a second time I run into some problems because we use tables with more than one geometry.
    When GeoServer renders objects with more than one geometry on the map, it creates a query where it asks for objects which one of the two geometries interacts with the query window. This type of query always fails with "End of TNS data channel" error.
    We are running Oracle Standard 11.1.0.7.0.
    Here is a small script to demonstrate the error. Could anyone confirm that they also have this type of error? Or suggest a fix?
    What this script does:
    1. Create table object1 with two geometry columns, geom1, geom2.
    2. Create metadata (projected coordinate system).
    3. Insert a row.
    4. Create spacial indices on both columns.
    5. Run a SDO_RELATE query on one column. Everything is fine.
    6. Run a SDO_RELATE query on both columns. ERROR: "End of TNS data channel"
    7. Clean.
    CREATE TABLE object1
    id NUMBER PRIMARY KEY,
    geom1 SDO_GEOMETRY,
    geom2 SDO_GEOMETRY
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM1',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM2',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO object1 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(550000, 450000, NULL), NULL, NULL));
    CREATE INDEX object1_geom1_sidx ON object1(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    CREATE INDEX object1_geom2_sidx ON object1(geom2) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE' OR
    SDO_RELATE("GEOM2", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    DELETE FROM user_sdo_geom_metadata WHERE table_name = 'OBJECT1';
    DROP INDEX object1_geom1_sidx;
    DROP INDEX object1_geom2_sidx;
    DROP TABLE object1;
    Thanks for help.

    This error appears in GeoServer and SQLPLUS.
    I have set up a completly new database installation to test this error and everything works fine. I tried it again on the previous database but I still get the same error. I also tried to restart the database, but with no luck, the error is still there. I geuss something is wrong with the database installation.
    Anyone knows what could cause an error like this "End of TNS data channel"?

  • Problem with more than one item in a track

    DVDSP 4.0.2 / OSX.4.2 I've built a DVD with several tracks. In each track I've placed several .m2v files, one after another. Finished build plays fine on my Mac and on one of my stand alone DVD players. But on another stand alone (Sony DVP-S360) something very odd happens. DVD begins to play just fine, but whenever it encounters a track with more than one source file, it will play until it gets to the spot in the program where the second source file is in the track and then it hangs and won't do anything. I'm just curious if anyone has any insight into this problem. Is it a DVDSP conflict thing with certain players? Or is this Sony player just not capable of playing a DVD built this way? Thanks.

    This page here:
    http://www.videohelp.com/dvdplayers.php?DVDnameid=428&Search=Search&
    has someone talking about finally getting burned DVDs to work, which suggests they previously had problems. I can't think why the track would not seem like continuous video, as if it had always been that way. Our Sony DVD player at work seems sensitive to higher data rates. What data rate did you use?

  • Reports 9i Graphs with more than one query..

    Hello,
    I am converting my 6i reports to 9i reports. On my graph reports with more than one query, when I invoke the graph wizard it changes the value of the src to the wrong query automatically. When I run my report, I am getting the error REP-0069 Internal Error rwlib-1: REP-6219 Column (Column Name) not in given cursor hierarchy. Although it's a pretty easy fix to go into the graph settings in the property palette and change it back, it is extremely frustrating. Has anyone else ran into this problem and did you find a permanent fix?
    Thanks,
    Laura

    Hi Laura
    One workround would be to create a new query in the Data Model that includes desired fields, and then source
    chart to the new group.
    FYi, bug2527100 was filed on this issue and is already fixed. The fix would be available in 9i Reports 9.0.2.2 patch. Reports 9.0.2.2 patch is scheduled to be released on Mar 05 2003 (tentative date).
    Thanks
    The Oracle Reports Team

  • Generating excel with more than one tab

    Hi,
    I would like to ask if anyone of you know how to generate excel file from Oracle Reports with more than one tab? Is it possible? If yes, can you provide me some references on how to do it. Thanks in advance.

    Hi,
    Do this:
    1. Create an Excel file, put some dummy data in 2 or more worksheets. Save as HTM. This will create one main HTM file, and some sub-files under a folder. One HTM sub-file will be created per worksheet. In addition, one XML sub-file (called filelist.xml) and some other sub-files will be created. (you have already done this)
    2. Open one of the HTM sub-files in reports builder, and follow the steps shown in the Excel Demo on OTN to insert data in this file at appropriate place, and save as JSP.
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/excel/index.html
    3. You can repeat this step for all worksheets. So finally you will get one JSP file per worksheet.
    5. Now open the main file in reports builder, and add the Excel contentType element at the top
         <%@ page contentType="application/vnd.ms-excel; charset=windows-1252" %>
    6. In this file, search for the following tag
         <x:WorksheetSource HRef="./filename_files/sheet001.htm"/>
    Note that instead of filename_files you will have your own file name
    Change this tag as following:
         <x:WorksheetSource HRef="./filename_files/sheet001.jsp?userid=scott/tiger@myDb"/>
    Note that in userid, you must provide your own DB connect string
    7. Additionally, change ALL references to sheet001.htm in this file to sheet001.jsp
    Do steps 6 and 7 for sheet002.htm, sheet003.htm, and so on (if needed).
    8. Open filelist.xml (you will find this file inside the folder that contains sub-files). Here, too, change all references to JSP instead of HTM
    9. Now place the main JSP file as well as the folder containing all sub-files inside your J2EE deployment folder. Run the main JSP file. This will run the associated JSP files (the worksheets).
    This will do the trick.
    If you are worried about placing the USERID information inside your JSP code, then you can use CGICMD.DAT file, and place the userid there.
    Navneet.

  • Can I use a magic trackpad with more than one Mac at a time?

    I am attempting to pair a MTP with a second MacBook Pro.  So far I can't get system preferences to find the MTP.
    I am wondering whether the MTP can be paired with only one Mac at a time, and that this is why my MBP won't find it.
    The reason I am thinking this is because the little booklet that comes with the MTP says 'after you pair your MTP with a Mac, you can pair it again with a different Mac.  To do this, you first remove the existing pairing and then pair the trackpad again'.
    Can anyone advise, please?
    If it can be paired with more than one MBP at a time, any suggestions why my system preferences search for the MTP is not producing any results?
    Thanks

    Yes, your keyboard, mouse or trackpad can be paired with multiple Macs.  You can even have multiple keyboards, mice or trackpads paired with one Mac.  The caveat is that the device can only be connected to one Mac at a time.  The device can't be paired or connected with a Mac while it's currently connected to another.
    Pairing a device with 2 Macs will be troublesome if the Macs are located within 33 ft of each other.  The device will connect with the first available paired Mac and then unavailable to the second.   If the Macs are located outside the 10meter range, it's quite easy to power off the keyboard (forcing a disconnect) then walking the keyboard to Mac 2 and powering the keyboard on.   I do this with a keyboard from my iMac to a Mac Mini in another room.
    Captfred

  • Send email from SAP with more than one attachment

    Hi all,
    How can i send email with more than one attachment and different types of document(doc,pdf,etc.) from SAP to external?
    Besr regards,
    Munur

    Hi,
    I use :
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    the main problem with different attachemts is to genereate the packing_list.
    the packing list is a kind of description of the data table... where ist the start  of an image, end, size...
    "Creation of the entry for the compressed attachment
            objpack-transf_bin = 'X'.                    " it could be an image
            objpack-head_num = lv_head_num_count .  " inital 1 each att  add 1
            objpack-head_start = 1.                     " fix
            objpack-body_start = gv_startnum.    " table with attachments  1. line one
            objpack-body_num = tab_lines.          " how many lines are in the table of attachment
            objpack-doc_size = tab_lines * 255.   " size of the  attachment...
           objpack-doc_type = lv_typ . " 'JPG'.
            objpack-obj_name = 'ATTACHMENT'.
            objpack-obj_descr = lv_stripped_name  " name of the JPG
       APPEND objpack.
       APPEND LINES OF lt_goscontent TO gt_maildata.  " data Table...
    bestreg
    robert

  • Can I use my iTunes Store account with more than one PC ?

    Hi all,
    Am I able to use my iTunes Store account with more than one PC ?
    I use my account on my PC - but I would like to download the latest version of iTunes onto my Mum's laptop, log in to my own iTunes Store account and rent a movie for her to download onto the laptop.
    Is this possible and would I still be able to use my account on my PC at the same time?
    Many thanks,
    Steve.

    Good question.
    I don't think you can--if I'm incorrect, someone will tell me--but it seems to me to be easier to simply open an iTunes account for your mom. Then get her a gift card, load it into iTunes for her, and rent a movie that way. Not elegant at all...but workable.
    Doc

  • Spatial index creation for table with more than one geometry columns?

    I have table with more than one geometry columns.
    I'v added in user_sdo_geom_metadata table record for every column in the table.
    When I try to create spatial indexes over geometry columns in the table - i get error message:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
    ORA-06512: at line 1
    What is the the solution?

    I'v got errors in my user_sdo_geom_metadata.
    The problem does not exists!

Maybe you are looking for