Filtering out rows which include 2 underscores

I was wondering if anyone has an example of code which you can exclude data which includes 2 underscores next to each other.
Here is my query which doesn't work:
SELECT i.interface_id,
i.interface_name,
s.site_id,
s.site_name,
s.database_server_id
FROM interfaces i,
sites s,
companies c
WHERE i.site_id = s.site_id
AND s.company_id = c.company_id
AND c.company_id = :company_id
AND s.site_name NOT LIKE '%__%';
I was thinking of using the CHR() function in the where clause but can find no example of this being done.
Any help would be appreciated.
Thanks
ReedK

Hi Reed,
don't confuse the SQLPlus "escape", with the escape in SQL LIKE clauses.
This is the ANSI syntax for LIKE regardless whether your are using PL/SQL, SQLPlus or something else.
SELECT i.interface_id,
       i.interface_name,
       s.site_id,
       s.site_name,
       s.database_server_id
FROM   interfaces i,
       sites s,
       companies c
WHERE  i.site_id = s.site_id
AND    s.company_id = c.company_id
AND    c.company_id = :company_id
AND    s.site_name NOT LIKE '%\_\_%' escape '\';Jens

Similar Messages

  • Filtering out field which include 2 underscores

    I was wondering if anyone has an example of code which you can exclude data which includes 2 underscores next to each other.
    Here is my query which doesn't work:
    SELECT i.interface_id,
    i.interface_name,
    s.site_id,
    s.site_name,
    s.database_server_id
    FROM interfaces i,
    sites s,
    companies c
    WHERE i.site_id = s.site_id
    AND s.company_id = c.company_id
    AND c.company_id = :company_id
    AND s.site_name NOT LIKE '%__%';
    I was thinking of using the CHR() function in the where clause but can find no example of this being done.
    Any help would be appreciated.
    Thanks
    ReedK

    Hi Reed,
    you can specify an escape character (preferably one that doesn't exist in your site_names).
    SELECT i.interface_id,
           i.interface_name,
           s.site_id,
           s.site_name,
           s.database_server_id
    FROM   interfaces i,
           sites s,
           companies c
    WHERE  i.site_id = s.site_id
    AND    s.company_id = c.company_id
    AND    c.company_id = :company_id
    AND    s.site_name NOT LIKE '%\_\_%' escape '\';Jens

  • Filtering out rows based on field value

    Hello,
    I have something like this:
    create table stuff
    avalue varchar2,
    anothervalue varchar2,
    thirdvalue varchar2,
    anumber number
    INSERT INTO stuff Values('abc', 'cde', efg', 2);
    INSERT INTO stuff Values('abc', 'cde', efgggg', 4);
    INSERT INTO stuff Values('abc', 'xxx', efg', 1);
    INSERT INTO stuff Values('abc', 'xxx', efgxxx', 2);
    INSERT INTO stuff Values('abc', 'yyy', efg', 2);
    I would like to recieve the rows with the higest 'anumber'-value, grouped by 'avalue', and 'anothervalue' (but not 'thirdvalue'). So in this example I want row 2, 4 and 5.
    Anyone have an idea? I'm thinking a 'order by desc' is not the best way here?

    select  avalue,
            anothervalue,
            thirdvalue,
            anumber
      from  (
             select  s.*,
                     rank() over(partition by avalue,anothervalue order by anumber desc) rnk
               from  stuff s
      where rnk = 1
    AVALUE     ANOTHERVAL THIRDVALUE    ANUMBER
    abc        cde        efgggg              4
    abc        xxx        efgxxx              2
    abc        yyy        efg                 2
    SQL> SY.

  • How to find out in which role an authority object is included

    Hi,
    I need to call web services by an external application. Therefore the authorization object S_SERVICE is needed to call services.
    Now I want to add this object to a specific sap user, but how can I find out in which role this object is included? I don't want to create a new role for just only this standard SAP authority object.
    Thank you!

    >
    Torben Larsen wrote:
    > Hey!
    >
    > Thank you for your answer. I have now found roles, which include this object. But I still have the authorization problems and can see that the object S_SERVICE is the problem, when tracing with ST01.
    >
    > I'm not that much into authorization stuff. So do I need also a profile? I only could call the web services by using profile SAP_ALL.
    >
    > thank you!
    Now that you have required role with you .. simple assign that role to user id from transaction SU01 (Roles tabs).
    Sap standard roles will already have profile in it. You might have to generate the profile. Goto transaction PFCG enter role name hit display button , goto Authorisation tab, hit Display Authorisation button and on next screen press generate button (Shift+f5).
    By the way you can use SUIM to find role and profile for given authority object

  • Wrong value in Result Row in a query which includes 1:N relationship SO/Inv

    Dear all,
    I have an InfoSet which includes sales order DSO, PO DSO and Invoice DSO. The purpose is to design a report to show 3rd party order flow.
    Now I met an issue if one sales item contains multiple billing doc. Below is an example:
    Sales doc: S001   order Qty is 600, there are two invoices for this order B001 invoice 200 and B002 invoice 400. Now in report we see below:
    Sales Doc. --   Invoice no.   ---  Order Qty  --   Invoice Qty
      S001 ---B001         -
           600        -
             200
      S002 ---B002         ---        600         -
            400
    Result Row     -
                                     1200      ---            600
    We can see in Result Row totsl order qty is 1200 which is wrong.
    I am wondering if anybody have such experience and the method soving this problem ? Many thanks in advance !

    Hi,
    Normal aggregation calculates the result row as a summation.  However, you can change this default behaviour by using Exception aggregation at "Order Qty" key figure.
    You can find a detailed article with examples about Exception aggregation at:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0b8ed5b-1025-2d10-b193-839cfdf7362a
    I hope this helps you.
    Regards,
    Maximiliano

  • Ruling/filtering out Activities due for shipping

    Hello.
    First time poster. Tried to search the forums for a solution, but couldn't find apparently.
    In our company, the warehouse has the responsibility of printing out activities, but we would like to filter out any entries that does not have sufficient stock available. As per now, we see a growing list of orders that won't print simply because we do not have the needed materials. We also see orders of return - which is not our responsibility.
    So, is there an option of ruling or filtering out, so that we only see activities due for shipping with available materials?
    Thanks in advance.

    Try TCode VL10A.
    Standard/default CalcRuleDefltDlvCrDt is 2-Today and tomorrow, which will include sales doc due for delivery within Today & Tommorrow.
    (Where, Rule for determining default value for deliv. creation date = CalcRuleDefltDlvCrDt)
    You can also use
    3 for *Due for shipment by the end of next week ( past-due delivs)*+
    4 for Due for shipment tomorrow (includes past-due deliveries)
    Regards
    JP

  • Number of rows which can be retrieved in Discoverer Report

    Hi All,
    Is there any maximum limit on the number of rows which can be retrieved in Discoverer Report.
    Regards,
    Ankur

    Hi ankur,
    Rows for tables are fetched from the database incrementally in groups. The number of rows in each group is specified in the Options dialog box based on the value set in the option "Retrieve data incrementally in groups of." Click the Query Governor tab on the Options dialog box to see that option.
    To override that setting you can retrieve all the rows at once instead of incrementally. Retrieving all rows applies only to tabular style reports.
    * To retrieve all the rows at once instead of incrementally, choose
    Sheet | Retrieve All Rows. The table includes all the rows.
    * To count the number of rows choose Sheet | Count All Rows.
    I think there would be some maximum limit,do check it out.
    By,
    Kranthi.

  • HT5624 I was prompted to update to ios7 so I did as usual. But this update has made my ipad a piece of junk. I am unable to access Siri, I can't read the faint print particularly those tiny letters on the top row which show the visited websites, etc.

    I updated to iOS 7  last might after being prompted by Apple. This caused me to lose many useful features of my iPad2. First I find that Siri has disappeared. When I contacted Apple support, the guy who took my serial # and model # verified things on his end and said emphatically that I should have Siri, but could't help me find it. Another rep simply disconnected me after seeing that she was unable to help me with the problems. After wasting hours with these people and waiting several minutes for their promised supervisor to come online, I was again disconnected by them. My second major problem I wanted solved was the hard to read fine and faint print. I don't have good eyes and with iOS 7 on my iPad2 I am now unable to read the top row which has the list of websites in avery faint and fine print. I could read everything on my iPad until yesterday evening when I made the mistake of updating to iOS7. Till yesterday evening I loved my iPad but after that update to iOS 7 last night it is a piece of junk for me. Hope there is help somewhere out there to restore  Siri and other useful features of iOS 6 or get iOS6 back on my ipad So I can use it again. The chat with apple support has not helped at all as they themselves did not know that Problems like the ones I mentioned to them even existed with this iOS 7. I want my iOS 6 back!!!! CAN ANY ONE HELP !!!!! Also how can I reach anyone in Apple who is knowledgable and also has some authority to do something about it.

    Outside of the contact number for that you've already used I don't know another way of direct contact. Here are some things that they may or may not of had you try that might help you. If you will go to the settings app and pick general on the right-hand side you will see accessibility. Within that you can adjust a text size make the text bowl you can also increase the contrast. You can also adjust the brightness and control panel.
    As for Siri again in the settings app under general you should see Siri on the right-hand side with the switch to turn it on. If that is turned on and you're still having issues
    Try a Restart. 
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider. Press and hold the Sleep/Wake button until the Apple logo appears.
     Resetting your settings
    You can also try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. You won't lose any data, but it takes time to enter all of the settings again.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears. Apple recommends this only if you are unable to restart it.
    Or if this doesn't work and nobody else on the blog doesn't have a better idea you can contact Apple. 
    Here is a link to their contacts with most of the information below. 
    http://www.apple.com/contact/

  • How to find out  number of includes for a given program dynamically

    Hi all
    I have a requirement in which, I have to find out  number of includes and their names for a given  user defined program dynamically
    if u know the answer pls let me know
    Thanks in advance
    Devi

    Hi rama,
    1. use this FM - RS_GET_ALL_INCLUDES_FOR_PRTAB
    regards,
    amit m .

  • Filtering the rows of a JTable based on JCombobox selection

    Hi,,,
    I write an application where I have a combobox contains the JTable first column data when i click on the item it should give me the rows, which contains the selected item as their first column data. I am enable to get the list like that, please, help me in this.........................................
    Thanks In Advance,
    Sun_sgrk

    Hi Albert,
    I write the code like this.............., please, check it, if I am following any where wrong let me know.......
         JComboBox filterCb=(JComboBox)evt.getSource();
            if(filterCb==filterComboBox){
                for(int i=0;i<wtOb.length;i++){
                    for(int j=0;j<4;j++){
                        if(wtOb[0].toString()==filterComboBox.getSelectedItem())
    System.out.println(""+wtOb[i][j]);
    This code I written in netbeans, when I am printing the values of wtOb[i][j] in console its getting the rows, suppose I am selecting the topic as GeneralTopic then its givining me the output as-----
    GeneralTopic
    Dealer5
    Player3
    BlackJack2
    GeneralTopic
    Dealer7
    Player6
    BlackJack
    but I am getting the trouble when i want to show these rows only in my table, please, give me any suggestion or any help to resolve it. I tried with table.setModel also but its not working.
    Regards,
    sun_sgrk

  • I recently changed my plan to the photoshop plan which includes photoshop and Lightroom but LR won't let me go into the Develop Module or the other Modules because it says Develop Module is disabled. Please renew your membership to reactivate. I'm still a

    I recently changed my plan to the photoshop plan which includes photoshop and Lightroom but LR won't let me go into the Develop Module or the other Modules because it says Develop Module is disabled. Please renew your membership to reactivate. I'm still a member so why won't it let me go into Develop Module? or any of the other modules?

    The Photoshop LR CC is active but you have not yet activated it. The activation server shows it. Please log out & log back in of the CC desktop CC.
    The Complete CC purchased last year is active till 11th of July. In case after logging out & logging back in does not resolve the issue, please contact Customer support Contact Customer Care
    Regards
    Rajshree

  • Need a Cheque which includes DD amount and DD Charges

    Hi All,
               I need a Cheque which includes Demand Draft amount of Rs1500 and Demand Draft Charges amount Rs 150.
               My Requirement is When I pass single out going paymet transaction entry should come like:
    Customer Should Debit   Rs 1500
    Bank Charges should Debit Rs 150
    SBI account should credit Rs 1650
    We give check of Rs 1650 to our boys to get the DD of Rs 1500
    and Rs 150 is DD charges.
    This should come when i pass single Out Going payment.
    We normally raise Out going payments selecting A/R Invoice.

    Hi,
    I am afraid but the only option you have is to create a Payment on Account for DD charges/bank Charges.
    The same is discussed in many threads on the forum :
    Bank Charges - Outgoing Payment
    Re: DD Charges
    Kind regards,
    Jitin

  • Finding out in which albums I put my photo

    Library getting bigger and bigger.
    To me it would be very useful sometimes to find out in which album a certain foto has been included, already. I tend to forget.
    Since there is a database concept behind iphoto this should be easy. But how? Any clue?
    Click a foto in the Library, press a key and there is a list of all Albums where the photo is included. Can even select an Album and press delete if I dont want the photo to be there anymore. Am I dreaming?
    Loris

    If you named your photos instead of just the default number from the camera you would be able to search for it.

  • Pass Prompt values into Legend / '-ALL-' filter filters out all records

    Hi
    I have 2 questions for the same chart so I hope it's OK to add them in one post.
    Firstly I have created a chart & added three Select List filters which work fine, the query is below, problem is that when I change back to '-ALL-' I get no data, it has filtered out all records as no data matches the value of '-ALL-' does anyone know the code to get around this?
    My chart query;
    select null link, P_MONTH AS MONTH, SUM(CALLS) AS data
    from DATA.MAIN_DATA
    WHERE WAREHOUSE = :P1_WAREHOUSE
    AND ANS_UNANS = :P1_ANS_UNANS
    AND PRODUCT = :P1_PRODUCT
    GROUP BY P_MONTH
    As I will have several queries like the one above for different options on the same chart, I would like the Legend to show what the user has chosen each time the options are changed ie;
    Something like the bolded text in the query to display the chosen values in the legend;
    select null link, P_MONTH AS MONTH, SUM(CALLS) AS 'P1_WAREHOUSE' || 'P1_ANS_UNANS' || 'P1_PRODUCT'
    from DATA.MAIN_DATA
    WHERE WAREHOUSE = :P1_WAREHOUSE
    AND ANS_UNANS = :P1_ANS_UNANS
    AND PRODUCT = :P1_PRODUCT
    GROUP BY P_MONTH
    Any ideas/suggests?

    Thanks Andy
    I'm having some problems with applying this so it may be best if I show you how I've applied this code.
    Here's an example of my data on a made up 'EMP' table;
    ENAME     SAL     DEPTNO     DEPARTMENT
    SMITH1     1871     345     DEPT1
    SMITH2     1953     345     DEPT2
    SMITH3     2239     345     DEPT3
    SMITH4     492     345     DEPT4
    SMITH5     2431     345     DEPT5
    SMITH6     2331     345     DEPT6
    SMITH7     1003     369     DEPT7
    SMITH8     1688     370     DEPT8
    SMITH9     2284     371     DEPT9
    So I'm only using one table - 'EMP'
    I've created 2 LOVs, 'DEPTNO' & 'DNAME'.
    'DEPTNO' LOV has the values for the 'DEPTNO' field in the table.
    'DNAME' LOV has the values for the 'DEPARTMENT' field in the table.
    I then created a chart with the below SQL query as its source;
    SELECT NULL LINK,ENAME LABEL,SAL VALUE
    FROM EMP
    WHERE (DEPTNO = :P1_DEPTNO OR :P1_DEPTNO = 0)
    ORDER BY ENAME
    The 'Chart Title' field under the 'Chart Attributes' tab has the below added;
    Department - &P1_DNAME.
    The COMPUTATION is as below;
    SLECT NVL(DEPARTMENT, '-ALL-')
    FROM EMP
    WHERE DEPTNO = :P1_DEPTNO
    Could you advise where I may be going wrong as I have the following errors;
    1. The chart is working OK with the added '(DEPTNO = :P1_DEPTNO OR :P1_DEPTNO = 0)' clause - but I still get no results for '-ALL-'
    2. I can't get the chart to display the current value in the legend - where exactly should I put this line - 'Department - &P1_DNAME.'
    3. The Computation is stopping any data from showing in the chart

  • How to findout rows which are not null ?

    Hi friends,
    Can anyone tell me how to find out the no of rows which is having full data in each column (not null) ?
    Ex:- TEST_TABLE having 1000 columns and lakes of rows.
    myQuestion:- I need to find the no of rows which are filled with 1000 columns filled with not null data.
    Thanks in Advacne.
    Kishore.

    Hello
    You're just going to have to write the query with IS NOT NULL on each column. This will help generate the predicates for the WHERE clause to save quite a bit of typing...
    SELECT
        ' AND '||column_name||' IS NOT NULL'
    FROM
        all_tab_columns
    WHERE
        table_name = 'TEST_TABLE'You can take the output and add that to
    SELECT COUNT(*) FROM test_table WHERE 1=1 HTH
    David

Maybe you are looking for

  • Why does the Motorola Droid RAZR M wi-fi no longer work even when it says it is connected after the kitkat update?

    Ever since the kitkat update to Android the wi-fi no longer autoconnects to the home network and when it is manually forced to it says it is connected but the internet does not work.  Tried soft-boots and deleting and reinstalling wi-fi connects and

  • I do not have a photo button option

    I do not have the option to sync or upload photos to itunes because I do not have the button as an option. This is a new computer and a new ipad. I was able to get it to work once and upload pictures to my ipad from my old laptop but now its not even

  • Check a group assigned to which role

    Hi, I have a group called as "GroupOne". There are no roles/users assigned to this. Now, how can we check whether any roles has added group "GroupOne" to its Assigned Groups under Identity Management. I know its a silly question, but I am not able to

  • How to remove graph prompt borders in OBIEE 11.1.1.6 (BP1)

    Hello, I have a requirement to remove the borders of a graph prompt that we have in place. The version for OBIEE is 11.1.1.6 (BP1). Just, to make my question clear, I understand it is not similar to_ OBIEE 11g – Remove Border Around Section Prompt. A

  • Git version of bti fails to compile

    Hi, I'm trying to compile the git version of bti (an  console client for twitter and identi.ca) (http://www.kernel.org/pub/linux/kernel/people/gregkh/bti/ , <http://github.com/gregkh/bti/ http://github.com/gregkh/bti/>). When I run ./autogen.sh, it s