Not Like in SQL not working

Trying to use not like in the following sql:
select *
from respondents
where sample_id = 00000001
and email not like '%cccp.org%';
Right now, I'm getting back 51 rows, but 1/2 of the rows have the wrong domain in the email fields, and I need to filter all of the wrong ones, except cccp.org.
There was a thread,
NOT LIKE
And I tried that, but not getting the correct results.
thanks

Given a simple table like:
SQL> SELECT * FROM t;
EMAIL
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected] WHERE email NOT LIKE '%cccp.org%' will return:
SQL> SELECT email FROM t
  2  WHERE email NOT LIKE '%cccp.org%';
EMAIL
[email protected]
[email protected]
[email protected] is exactly what you asked for. However, this statement "1/2 of them have the wrong email domain, like .edu and .com email domains" seems to contradict the predicate. Do you really want something more like:
SQL> SELECT email FROM t
  2  WHERE email LIKE '%cccp.org%';
EMAIL
[email protected]
[email protected]
[email protected]
John

Similar Messages

  • HT4623 I do not like the new iOS 7 operating system on my iPad.  I do not like the Safari works, I do not see a way to enter or search for a new web site.  Is there a way that I can go back to the older operating system?

    I do not like the new iOS 7 system on both my iPad 2 and iPhone 4S.   I can not like the way Safari works, I can not see a way to enter name to search for new web sites.  Is there a way I can go back to the old iOS 6.1.5 operating system on my devices?  Thank you.

    I can not see a way to enter name to search for new web sites
    Put your search terms in the combined URL and search bar at the top of the browser (exactly the same as you do in most modern desktop browsers such as Chrome, Safari, Explorer). There is no separate search box, just use the box where you enter web addresses.
    And no, you cannot downgrade.

  • Not Like in Select Statement

    Hi All,
    My requirement is not to select the entries for the T024 table where the eknam is either starts with 'NOT VALID' or blank.
    For that, I have written the select statement using NOT LIKE,
    Will this negation in the select statement cause extra execution tiem?
    If so, can you give some hint for alternative statement.
    SELECT EKGRP EKNAM FROM T024 INTO TABLE IT_T024
    IT_PURC WHERE EKGRP = S_EKGRP AND EKNAM NOT LIKE 'NOT VALID%' AND EKNAM NOT LIKE ' '.
    Thanks,
    Kal Chand

    Hello,
    For the first condition: not starting with 'NOT VALID' , I don't know other way apart from yours: EKNAM NOT LIKE 'NOT VALID%'.
    For the second one, not starting with blank: EKNAM NOT LIKE ' '. Does it work? I think it compares if EKNAM is different from blank which can be done using:  EKNAM NE ' '.
    I hope it will help you.

  • Alternate for NOT LIKE....

    I am using NOT LIKE in sql query....it is running gud in dev instance,But in prod instance it is causing performance issue.
    can any one pls suggest alternate for NOT LIKE.
    But in dev n prod having same data.
    Thanks,
    Sai

    Hi Saichand,
    well, actually what do you expect? ;)
    You ask the DB to filter out specific lines and this takes time.
    What worries me is the fact that it performs fine on the development environment, but runs slow on the production environment. Did you find out what the reason for this is? Is the prod system loaded too heavily?
    There are many alternatives for "NOT LIKE". Within SQL and even outside of SQL. You can do the filtering in the final application even. Would not recommend this, but sometimes it's faster to just stream the data to the final application and to the processing there (if the processing takes lot of CPU and your DB is anyway loaded already too much).
    I'd try to find out why the dev is faster than the prod env. Normally it should be the way round ;)
    regards,
    David.

  • My Fascinate does not like Android 2.2 Froyo

    Ok, just got the Android 2.2 Froyo update today. My Fascinate does not like it. Nothing works the way it used to, and the "pretty" they put on it does not make up for the pain in the **bleep** it has become. Try to delete single or multiple image and it locks up, takes forever to open some apps. Media scanner will start and will not stop. Shutting down and restarting does not help. Is there any was to go back to the old software that works? Thanks for any help or info. DLS

    darklightusn wrote:
    Ok, just got the Android 2.2 Froyo update today. My Fascinate does not like it. Nothing works the way it used to, and the "pretty" they put on it does not make up for the pain in the **bleep** it has become. Try to delete single or multiple image and it locks up, takes forever to open some apps. Media scanner will start and will not stop. Shutting down and restarting does not help. Is there any was to go back to the old software that works? Thanks for any help or info. DLS
    I first would try a factory reset and then still unhappy with the results, you have a couple of choices, ask for a replacement or revert to version 2.1, and yes, you can revert but only if you go to Android Central Fascinate forums

  • LIKE operator is not working in SQL Query in XML file

    Hi Gurus,
    LIKE operator is not working in SQL query in XML template.
    I am creating a PDF report in ADF using Jdeveloper10g. The XML template is as follows
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="catalogDataTemplate" description="Magazine
    Catalog" defaultPackage="" Version="1.0">
    <parameters>
    <parameter name="id" dataType="number" />
    <parameter name="ename" dataType="character" />
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
       SELECT ename, empno, job, mgr from EMP where deptno=:id and ename LIKE :ename || '%']]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="EmployeeInfo" source="Q1">
    <element name="EmployeeName" value="ename" />
    <element name="EMPNO" value="empno" />
    <element name="JOB" value="job"/>
    <element name="MANAGER" value="mgr" />
    </group>
    </dataStructure>
    </dataTemplate>
    if i pass the parameter value of :ename from UI, it doesn't filter. But if I give ename = :ename it retrieves the data. Can anyone help me why LIKE operator doesn't work here?
    Appreciate your help,
    Shyamal
    email: [email protected]

    Hi
    Well for a start, you are doing some very strange conversions there. For example...
    and to_char(a.msd, 'MM/DD/YYYY') != '11/11/2030'
    and to_char(a.msd, 'MM/DD/YYYY') != '10/10/2030'If a.msd is a date then you should e converting on the other side ie.
    and a.msd != TO_DATE('11/11/2030', 'MM/DD/YYYY')
    and a.msd != TO_DATE('10/10/2030', 'MM/DD/YYYY')Also, you may want to take into consideration nothing being input in :P2_ITEM_NUMBER like this...
    AND INSTR(a.item_number,NVL(:P2_ITEM_NUMBER,a.item_number)) > 0Is item number actually a number or char field? If it's a number, you want to explicitly convert it to a string for using INSTR like this...
    AND INSTR(TO_CHAR(a.item_number),NVL(TO_CHAR(:P2_ITEM_NUMBER),TO_CHAR(a.item_number))) > 0?
    Cheers
    Ben

  • I would like to compare a CSV field "Name" with a SQL Server table field "ResourceName" and write out the person that is not in the SQL server table.

    if (this.DataCenterLaborFileUpload.HasFile)
                    var extension = Path.GetExtension(DataCenterLaborFileUpload.FileName);
                    string currentName = "";
                    decimal currentHours = 0.00M;
                    decimal currentFTE = 0.00M;
                    string ResourceName = "";
                    if (extension == ".csv")
                        StreamReader csvreader = new StreamReader(DataCenterLaborFileUpload.FileContent);
                        DataTable dt = new DataTable();
                        dt.Columns.Add("txtName");
                        dt.Columns.Add("txtHours");
                        dt.Columns.Add("txtFTE");
                        while (!csvreader.EndOfStream)
                            DataRow dr = dt.NewRow();
                            var line = csvreader.ReadLine();
                            var values = line.Split(',');
                            if (values[0].Trim() != "Pers.No.")
                                using (DbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLStaffingConn"].ConnectionString))
                                    conn.Open();
                                    using (DbCommand cmd = conn.CreateCommand())
                                        cmd.Connection = conn;
                                        cmd.CommandText = "SELECT ResourceName FROM
    StaffTracking  order by PersonnelResourceType, ResourceName";
                                     //   DbParameter p1 = cmd.CreateParameter();
                                     //   p1.ParameterName = "restype";
                                     //   p1.Value = "Supplier";
                                     //   cmd.Parameters.Add(p1);
                                        using (DbDataReader row = cmd.ExecuteReader())
                                            while (row.Read())
    ResourceName = row.GetString(0);
    if (ResourceName != (values[1].Trim()))
    if (values[1].Trim() == currentName)
    currentHours = currentHours + Convert.ToDecimal(values[9].Trim());
    else
    if (currentName == "")
    dr["txtName"] = currentName;
    dr["txtHours"] = currentHours;
    dr["txtFTE"] = currentFTE + Math.Round(currentHours / (weekdaysInMonth() * 8), 2);
    dt.Rows.Add(dr);
    dt.AcceptChanges();
    currentHours = Convert.ToDecimal(values[9].Trim());
    currentName = values[1].Trim();
                        DataRow drfinal2 = dt.NewRow();
                        drfinal2["txtName"] = currentName;
                        drfinal2["txtHours"] = currentHours;
                        drfinal2["txtFTE"] = currentFTE + Math.Round(currentHours / (weekdaysInMonth() * 8), 2);
                        dt.Rows.Add(drfinal2);
                        dt.AcceptChanges();
                        gvDataCenterLabor.DataSource = dt;
                    gvDataCenterLabor.DataBind();
                    //     Page.DataBind();
    Here is my csv file:
    Pers.No.
    Name
    HomeFID
    Copy Range/Value from Column V
    Worked Date
    Job Code
    Account
    Pay Type
    Activity Type
    Hours
    11111111
    Doe Jane
    USA7064810
    US1-08333.01.08.02.03
    20150223
    00S15H
    9.61E+09
    410
    8
    11111111
    Doe John
    USA7064810
    US1-08333.01.08.02.03
    20150210
    00S15H
    9.61E+09
    410
    9
    11111111
    Smith Jane
    USA7064810
    US1-08333.01.08.02.03
    20150226
    00S15H
    9.61E+09
    410
    8
    So if Doe Jane is not in the SQL table I would like to only display her.
    It's only displaying the ones from the CSV file that are in the SQL Table.
    Thanks

    Hi
    Please use this insert
    code button to provide code next time. It could better to help us to review  your code.
    Now let's focus your question, I have tried to test with your code. But failed.
    I would suggest that you could export columns "Name" and "ResourceName" to DataTable.
    Then use DataTable to compare and filter with its column value.
    Here is a helpful reference:
    Comparingtwo DataTables by specific
    column in C# [closed]
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Commit Not Working in SQL (but works from icon)

    I can't figure this one out. When I write a script I am not getting a commit even though in the statement output it says "committed". However with the very same sql if I take the commit out and just run the statement and then use the commit icon it works. For example this will not commit from sql
    delete
    from
    test_table
    where user_id = 'abc123';
    commit;
    But if I run it like this and click the commit icon it does:
    delete
    from
    test_table
    where user_id = 'abc123'
    Any info much aprreciated

    How are you running it? If you use F9 (or the green arrow) it will only run one statement.
    If you use F5 (or the green arrow with a piece of paper behind it) it will run the whole worksheet ( or the selected area) as a script.
    If both statements are running you should see
    x rows deleted.
    Commit succeeded.

  • Works in sql not in apex: ORA-02049 distributed transaction waiting lock

    Hi,
    I get this error
    failed to parse SQL query:
    ORA-02049: timeout: distributed transaction waiting for lockwhen trying to run this query from it's page. But it works fine if I run it in the SQL console...
    failed to parse SQL query:
    ORA-select distinct n.notif_no,
           n.maint_work_centre,
           n.maint_work_centre_text,
           n.raised_by,
           n.notif_text,
           (select  (SAP_LONG_TEXT.NOTIFICATION_TEXT_1||SAP_LONG_TEXT.NOTIFICATION_TEXT_2||SAP_LONG_TEXT.NOTIFICATION_TEXT_3||SAP_LONG_TEXT.NOTIFICATION_TEXT_4||SAP_LONG_TEXT.NOTIFICATION_TEXT_5||SAP_LONG_TEXT.NOTIFICATION_TEXT_6||SAP_LONG_TEXT.NOTIFICATION_TEXT_7||SAP_LONG_TEXT.NOTIFICATION_TEXT_8||SAP_LONG_TEXT.NOTIFICATION_TEXT_9||SAP_LONG_TEXT.NOTIFICATION_TEXT_10||SAP_LONG_TEXT.NOTIFICATION_TEXT_11||SAP_LONG_TEXT.NOTIFICATION_TEXT_12||SAP_LONG_TEXT.NOTIFICATION_TEXT_13||SAP_LONG_TEXT.NOTIFICATION_TEXT_14||SAP_LONG_TEXT.NOTIFICATION_TEXT_15||SAP_LONG_TEXT.NOTIFICATION_TEXT_16||SAP_LONG_TEXT.NOTIFICATION_TEXT_17||SAP_LONG_TEXT.NOTIFICATION_TEXT_18||SAP_LONG_TEXT.NOTIFICATION_TEXT_19||SAP_LONG_TEXT.NOTIFICATION_TEXT_20||SAP_LONG_TEXT.NOTIFICATION_TEXT_21||SAP_LONG_TEXT.NOTIFICATION_TEXT_22||SAP_LONG_TEXT.NOTIFICATION_TEXT_23||SAP_LONG_TEXT.NOTIFICATION_TEXT_24||SAP_LONG_TEXT.NOTIFICATION_TEXT_25||SAP_LONG_TEXT.NOTIFICATION_TEXT_26||SAP_LONG_TEXT.NOTIFICATION_TEXT_27||SAP_LONG_TEXT.NOTIFICATION_TEXT_28||SAP_LONG_TEXT.NOTIFICATION_TEXT_29||SAP_LONG_TEXT.NOTIFICATION_TEXT_30||SAP_LONG_TEXT.NOTIFICATION_TEXT_31||SAP_LONG_TEXT.NOTIFICATION_TEXT_32||SAP_LONG_TEXT.NOTIFICATION_TEXT_33||SAP_LONG_TEXT.NOTIFICATION_TEXT_34||SAP_LONG_TEXT.NOTIFICATION_TEXT_35||SAP_LONG_TEXT.NOTIFICATION_TEXT_36||SAP_LONG_TEXT.NOTIFICATION_TEXT_37||SAP_LONG_TEXT.NOTIFICATION_TEXT_38||SAP_LONG_TEXT.NOTIFICATION_TEXT_39||SAP_LONG_TEXT.NOTIFICATION_TEXT_40||SAP_LONG_TEXT.NOTIFICATION_TEXT_41||SAP_LONG_TEXT.NOTIFICATION_TEXT_42||SAP_LONG_TEXT.NOTIFICATION_TEXT_43||SAP_LONG_TEXT.NOTIFICATION_TEXT_44||SAP_LONG_TEXT.NOTIFICATION_TEXT_45||SAP_LONG_TEXT.NOTIFICATION_TEXT_46||SAP_LONG_TEXT.NOTIFICATION_TEXT_47||SAP_LONG_TEXT.NOTIFICATION_TEXT_48||SAP_LONG_TEXT.NOTIFICATION_TEXT_49||SAP_LONG_TEXT.NOTIFICATION_TEXT_50) from sap_long_text@genadm where sap_long_text.notification = n.notif_no) "long",
           n.notif_date,
           n.funct_loc,
           n.order_no,
           n.notif_status,
           n.room,
           n.notif_type
    from   notifications@amt n, SAP_LONG_TEXT@genadm
    where  instr(':'||:P9_NOTIFTYPE||':',':'||n.NOTIF_TYPE||':')>0 and
           instr (':'||:P9_SITE||':',':'||n.site||':') > 0 and
           n.notif_date BETWEEN :P9_DATEFROM and :P9_DATETO and
           n.notif_status not like '%NOCO%'I've had this error before but I don't remember why/what happened. The page has been working fine, the error just randomly cropped up today.
    And a secondary question, is there a better way to write the query (it's a copy/paste from an older query). That select within the select is ugly...

    Hello,
    Take a look at the following thread -
    help ORA-02049
    Is it really necessary that you always query across the DBLink? Is using local materialized views not an option for you?
    John.
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • I had a repair done on my MacBook Pro and had to have a new hard drive installed. The Apple Auth Repair Shop then updated the OS from 10.6.8 to 10.7.5. Now my iPhoto v 9.2.3 will not open and it sounds like it will not work with this OS. Can you plea

    I had a repair done on my MacBook Pro and had to have a new hard drive installed. The Apple Auth Repair Shop then updated the OS from 10.6.8 to 10.7.5. Now my iPhoto v 9.2.3 will not open and it sounds like it will not work with this OS. Can you please advise?

    You may need many other updates to retain compatibility with Lion. I suggest you reinstall Snow Leopard. Unfortunately, you will need to erase the drive first. Be sure to backup your data if you haven't done so already.
    Clean Install of Snow Leopard
    Be sure to make a backup first because the following procedure will erase
    the drive and everything on it.
         1. Boot the computer using the Snow Leopard Installer Disc or the Disc 1 that came
             with your computer.  Insert the disc into the optical drive and restart the computer.
             After the chime press and hold down the  "C" key.  Release the key when you see
             a small spinning gear appear below the dark gray Apple logo.
         2. After the installer loads select your language and click on the Continue
             button. When the menu bar appears select Disk Utility from the Utilities menu.
             After DU loads select the hard drive entry from the left side list (mfgr.'s ID and drive
             size.)  Click on the Partition tab in the DU main window.  Set the number of
             partitions to one (1) from the Partitions drop down menu, click on Options button
             and select GUID, click on OK, then set the format type to MacOS Extended
             (Journaled, if supported), then click on the Apply button.
         3. When the formatting has completed quit DU and return to the installer.  Proceed
             with the OS X installation and follow the directions included with the installer.
         4. When the installation has completed your computer will Restart into the Setup
             Assistant. After you finish Setup Assistant will complete the installation after which
             you will be running a fresh install of OS X.  You can now begin the update process
             by opening Software Update and installing all recommended updates to bring your
             installation current.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.

  • I would like to use my work exchange email on my macbook pro.  But I cannot insult it.  I have not problem as on my iPhone or iPad.  My work IT person does not know what is wrong.

    I would like to use my work exchange email on my macbook pro.  But I cannot install it.  I have no problem my work email on my iPhone or iPad.  My work IT person does not know what is wrong.  Why I try to set up the email I get the message that it cannot connect to this server. 

    Try going into System Prefereces then Mail, Cintacts & Calendars then click on the Microsoft Exchange link on the right. Type in your email address and password and allow it to set it up automatically.
    Make sure your Mac is updated to the newest version of Mail.
    If that still fails then I suggest you switch email clients. I don't care for the built in mail program. IMHO it is very buggy.

  • My password no longer works and I have tried everything to change it.I cannot use my Thunderbird and had to go to Gmail...which I do not like.

    My Verizon broadband was always crashing (some software issue that has been resolved) and after that my Thunderbird email stopped working saying I needed a password. I have tried everything in every option and still cannot change the password and log in. It has been a month since I have been able to use Thunderbird. I got a gmail account which I do not like at all. I don't like the format. I have not tried to get my mail from Thunderbird to gmail since I am already having enough problems.
    I have even tried to uninstall Thunderbird and simply get a new one and start over but it always shows up my old one and thus I have the same password problem. My old version is never uninstalled properly which I find strange...even with a restart after the uninstall.
    Any help would be much appreciated so that I can use Thunderbird.
    Angela

    No idea what "tried everything" means.
    Here is how you troubleshoot a password problem.
    Go to your email providers web mail page and verify that you have a working username and password by logging into your account there. If you cannot log in there, look for the link to reset your password. Your email password is administered with your email provider.
    Once you have a working password you need to remove any stored passwords in Thunderbird and replace with the new, working password.
    From the menu bar select''' Tools-Options-Security-Passwords-Stored Passwords'''
    Remove the passwords for the problem account. Close Thunderbird and restart it. You will be asked for a password. Enter the new password.
    No menu bar with Tools? Press the '''alt '''key.
    FYI: Thunderbird settings are stored in a different file from the program. Removing the program and reinstalling just keeps you busy for a little while and rarely fixes anything. As you have seen the old settings are picked up when Thunderbird is reinstalled.

  • Facebook like button does not work in my FF 32.0.2

    Dear FF support-team,
    I've got a strange problem with the Facebook like button (in German called: "Gefällt mir") on my site and after some trying around myself, I need your knowledge, as mine seems not to be enough. :-)
    I have got a Facebook-Like button built in on my Wordpress-Site: See Reference: http://www.lifechange.at/kammel-scheck/ (at the bottom of the page).
    When I try to click it and I'm not logged in to Facebook, he opens up the popup and asks me to login. So far so got, but when I log in and try to "Like", he just opens the popup and closes it automatically after half a second and shows no like.
    When I open the "Like-Button"-Bar in an extra Tab (right click on Like-Button and select Current-Frame-->Open Frame in new Tab), then the Like-Button seems to work correctly.
    I have already cecked against all installed add-ons (deactivated completely, tested, reactivated). Especially AdBlockPlus. But I have deactivated AdBlockPlus on Facebook and on my Domain lifechange.at.
    Then I checked, if the Like-It - Link to Facebook was "https://" and not just "http://". That's also ok.
    On every other browser (Chrome, IE, Opera...) the Like-It Button works fine.
    And what's also interesting: the other FB-Button ("Share" ("Teilen") - Button) works fine even in Firefox.
    So you see, I will be lost without your help, for which I ask politely.
    Thanks a lot in advance.
    Greetz, Hannes

    Ahh, I forgot to mention: The "Google+" - Button also doesn't work. In all the other Browsers, it does. Thx, Hannes

  • Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Hi connally25,
    Below is a link to a video tutorial on how to add a Facebook Log button, please check if you have followed the same steps to add the video.
    http://tv.adobe.com/watch/learn-adobe-muse-cc/adding-a-facebook-like-button/
    If you have followed the steps correctly and the button still does not work; here is a link to a forum thread which might help solving the issue:
    Facebook Follow Widget not working
    Regards
    Sonam

  • P/SQL Not Working in SQL Developer

    The following P/SQL seems to work fine in SQL Plus but does not run in SQL Developer
    insert /*+ append */ into upl_exclude_claims
    (select /*+ ordered parallel(s,4) parallel(claim,4) */
    /*+ use_hash(s,claim) no_index(claim, xbm_clm_recip) */
    s.recip,
    s.month_1st_day
    from lrx.upl s,
    mcd.fact claim;
    Thanks

    911105 wrote:
    The following P/SQL seems to work fine in SQL Plus but does not run in SQL Developer
    insert /*+ append */ into upl_exclude_claims
    (select /*+ ordered parallel(s,4) parallel(claim,4) */
    /*+ use_hash(s,claim) no_index(claim, xbm_clm_recip) */
    s.recip,
    s.month_1st_day
    from lrx.upl s,
    mcd.fact claim;
    ThanksWhat happens when you run it? Do you get an error or does nothing happen?
    If you get an error post the message
    Why didn't the first answer I did to this question post???

Maybe you are looking for