Chris Hagwood wrote: >Is there a way to do something like this SQL statement with an array? > >SELECT * WHEN ID IN (1,2,3,4) > >I want to have an array of ID's, and if a variable is in that array, I'd like to go >ahead and process the script. I will need to make the array from a set of known >ID's, plus a value I'm pulling from a record in a Db. This is why I don't just make >a table of those ID's...it's dynamic. > >Do I just build the array, then loop through it to see if the variable matches it? >It's only about 4 values, but if there's a one-line function to do it, I thought I'd >use that instead. > > > I'm pretty certain that you can do that:
SELECT * FROM table WHERE ID IN (1,2,3,4) Should do the trick, I think. You pass the array in as a comma-delimited string. manzo ------------------------ Yahoo! Groups Sponsor --------------------~--> Yahoo! Domains - Claim yours for only $14.70 http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/17folB/TM --------------------------------------------------------------------~-> --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [EMAIL PROTECTED] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
