SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Feb 2005
    Posts
    737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Several like statements

    Hi,

    Quick and hopefully question. Say I have several 'Like' statements in a query, is there a cleaner way to clean it up:

    Code:
    SELECT * 
    FROM tbl
    WHERE col LIKE '%value1%'
    OR col LIKE '%value2%'
    OR col LIKE '%value3%'
    OR col LIKE '%value4%'
    OR col LIKE '%value5%'
    OR col LIKE '%value6%'

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    nope
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •