CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Database
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Database Discuss databases, database technologies, and database programming. ADO.NET and XML questions and comments have a separate forum.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 11th, 2009, 01:59 AM
    ssma ssma is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 3
    ssma is an unknown quantity at this point (<10)
    Regular Expressions Help

    Hi all,

    I am new to oracle sql, so I am having a lil' bit of hard time to understand the regular expression part. I have a table that contains last name and email address and would like to select the emails that match the last the name, for example select smith if his email is smith@xy.com
    I wrote the following query but it doesn't seem to be working, I would greatly appreciate any help

    SELECT lname
    FROM member
    WHERE REGEXP_LIKE(email, lname||'^@') ;


    Thanks
    Reply With Quote
      #2    
    Old November 11th, 2009, 04:29 AM
    jcaccia jcaccia is offline
    Member
     
    Join Date: May 2009
    Location: Surrey, UK
    Posts: 163
    jcaccia is an unknown quantity at this point (<10)
    Re: Regular Expressions Help

    Code:
    SELECT lname
    FROM member
    WHERE REGEXP_LIKE(email, lname||'@.+')
    This selects all records where the email is the surname followed by '@' followed by any number of any characters (must have at least one).
    Reply With Quote
      #3    
    Old November 11th, 2009, 10:22 PM
    ssma ssma is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 3
    ssma is an unknown quantity at this point (<10)
    Re: Regular Expressions Help

    Thank you very much
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Database


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:28 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.