Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: field in a table that stores my IN condition (was "In")


    Alright here is the issue. I have a field in a table that stores my IN condition.

    S0 I have a field that contains data like this: 'a','b','c'

    basically I now just want that to be my IN clause....any ideas???

    I tried something like this
    declare @in as varchar(10)
    set @in = (select field from table)

    select * from table
    where field in (@in)

    of course that does not work...and many variations of that also.

    Let me know if you can lead me down the right path on this.

  2. #2
    Join Date
    Aug 2004
    You may consider modifying your design to store 'a', 'b', 'c' as separate rows in your table instead of a string of possible values. That makes the SQL easier and you can do things like joins instead of the IN clause.

Posting Permissions

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