Results 1 to 5 of 5

Thread: select ...like

  1. #1
    Join Date
    Nov 2005
    Posts
    40

    Unanswered: select ...like

    how can i build a query select ... like
    with :

    select x,y, from y,z,
    where w like '%y%' ?????????

    I want the y to be the value and not a single string or character!!!
    For example if all the y's are values like names : "Peter,John,Bob,..." to find the w ' s that contain the name :"Peter,John,Bob,..." and not the y character or the &y or the $y e.t.c.Is there a way to do that ???

    Anyone idea???

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you are using the like clause then I suppose
    where forename like name1 or foremame like name2

    also where forename in (name1,name2,name3)

  3. #3
    Join Date
    Nov 2005
    Posts
    40
    Quote Originally Posted by healdem
    if you are using the like clause then I suppose
    where forename like name1 or foremame like name2

    also where forename in (name1,name2,name3)
    Yes sure,but what if i have 500 names??(in my case unfortunatelly i have)...

  4. #4
    Join Date
    Apr 2005
    Location
    Lier, Belgium
    Posts
    122
    Quote Originally Posted by archVille
    where w like '%y%' ?????????
    WHERE w LIKE CONCAT('%', y, '%')

    --
    felix

  5. #5
    Join Date
    Nov 2005
    Posts
    40
    Quote Originally Posted by felixg
    WHERE w LIKE CONCAT('%', y, '%')

    --
    felix
    Thanx a lot ! I have tried this without concat somehow and it didnt work!

Posting Permissions

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