[thelist] SQL (or ASP?) selecting from a multi-valued column

lanehol at bellsouth.net lanehol at bellsouth.net
Mon Feb 5 17:15:39 CST 2001

Hmmm ...

If you are using MSSQL then you could try:

"select * from display where [cat] in (" & CommaSeparatedList & ") order by [name]"

Note that the CommaSeparatedList must be delimited (with single or double quotes) if [cat] is a char value or with date delimiters if [cat] is a date.


> From: "Elfur Logadottir" <elfur at elfur.is>
> Date: 2001/02/05 Mon PM 10:19:50 EST
> To: <thelist at lists.evolt.org>
> Subject: [thelist] SQL (or ASP?) selecting from a multi-valued column
> ok, I'm really beginning to wonder if having that column
> multi-valued was a good idea.
> Now I'm doing a select request, based on what is in that
> column, with no luck.
> say the column holds the values, "1,3,6,9,10,11,12" but I
> want all the records that have "1" (one, not 1 as part of
> 10)
> how do I do that?
> I tried "select * from display where cat contains 1 order by
> name" but that returns "1,10,11,12".
> How am I supposed to build that select request.
> This cat field is holding ID info, that can be joined with
> another table, but is mainly deciding in which category the
> data is suppose to appear.
> While I really think that multi-valued column is the right
> way to go, I'm having some huge problems using it.
> thanks
> [elfur]
> *the frustrated one*
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 

More information about the thelist mailing list