Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009

    Unanswered: LIKE does not like!

    When using the following query with the colname "Edwards, III" I get no reponce. I'm guessing because of the coma. It does work when I use just "III"

    SELECT id, member_id, mfirst, mlast, agreedate, cdate
    FROM members
    WHERE mlast LIKE %colname%

    When I use the next query with the same names I get results from "Edawrds, III" but not from "III". Here I am not using LIKE my guess that is the difference.

    SELECT members.mfirst
    , members.mmiddle
    , members.mlast
    , members.member_id
    , label.descr_lbl , EXTRACT(YEAR
    FROM patients.cdate) AS Year
    , EXTRACT(MONTH FROM patients.cdate) AS yyyymm
    , COUNT(patients.doc_id) FROM members INNER JOIN label
    ON label.value_lbl = members.demo5
    INNER JOIN patients
    ON patients.doc_id =
    AND members.mlast =colname
    GROUP BY , yyyymm
    ORDER BY mlast, patients.cdate


    ps r937 may recognize this second one!

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    Quote Originally Posted by oldnickj
    ps r937 may recognize this second one!
    nope, sorry | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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