Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2011
    Posts
    2

    Red face Unanswered: Using 'Case' statement inside 'Where' clause

    Hi,

    I am all messed up putting an appropriate case statement into my 'where' clause but no correct results obtained yet, is there any way to do the following?

    Can anyone tell me the code for:-

    SELECT `column1`,`column2`,`column3`,`column4`, `column5`,`column6` ,`column7` FROM `tablename` WHERE `column7`NOT IN
    CASE `column2`
    WHEN '1' THEN ( 'abcd','efgh','ijkl','mnop')
    WHEN '2' THEN ' '
    END
    and `column6`>='0' order by `column2`,`column6`

    Thanks in advance

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Id suggest a sub select query
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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