SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    case select and multiple search options

    hi,
    i am using this search statement to search for certain characters in my db.

    Code:
    SELECT * FROM users WHERE email LIKE '%yahoo.com'
    however how do i search for multiple options e.g.

    To search and see if the resultsets have any of the following options ? IE: If any of the following are present then assign to a variable @variable

    1. yahoo.com
    2. hotmail.com
    3. mail.com

    this is a sample
    thanks

    Afrika

  2. #2
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,000
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code:
    SELECT * FROM users WHERE email LIKE '%yahoo.com' OR email LIKE '%hotmail.com' OR email LIKE '%mail.com'
    Simple as that..
    -- Jelena --

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot Jelena


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •