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

Elfur Logadottir elfur at lists.evolt.org
Mon Feb 5 17:45:37 CST 2001


From: "rudy" <r937 at interlog.com>


| > say the column holds the values, "1,3,6,9,10,11,12"
<snip>
| > I tried "select * from display where cat contains 1
| > order by name" but that returns "1,10,11,12".
|
| your multivalued column is a string

yeah, this much I figured.

| so you need to do this within the database query

can I? do I want to?
isn't there just an easier way out, that I haven't seen -
yet?

| you have a real problem here, don't you

boy, do I ever.

| > While I really think that multi-valued column is the
right
| > way to go, I'm having some huge problems using it.
|
| all those problems go away if you place the IDs into a
separate table

???
I have a special ID table, that is, I have a table that
holds only list of categories (id, name)
but I'm refering to that table, with this cat field in the
other tables, to decide if the records in question are to be
displayed or not.

| trust me on this

I do trust you, but hell if I understand you.

| and off the top of my head i just cannot see how you're
going to accomplish
| the join to the other table

Ok, I should have known better, I'm not thinking the
official "SQL join" when I say join, sorry about that.

|
| write back if you want more help, i'm here for ya
|

I'm writing back, and boy do I need more help.
I think that I do need some reconstruction done on my brain
and on this DB.

To give you a little insight, here's the structure:
This is a site of a group that is divided into 15
sub-groups, there is to be a site for the whole, with
content written once, but displayed in different
circumstances.
So I create a category table, including 15 categories. (mind
you, they could increase)
And I create a table for news items, another one for
articles, and the third one for member info.
each of those three tables contain a column where you decide
where the content is displaying, on which of those 15
categories the info is showing.

And here I'm stuck, I have no problem writing into the table
all the things supposed to be there - and I have no problem
in the admin part showing where the selected record is
displayed (thanks to lane).
I however have a problem isolating one category.

What I think I will do, is add one column to the categories
table, with a unique identification of each category and use
that rather than the id column.


whaddayathinknow rude?

thanks
elfur
*the grateful one*





More information about the thelist mailing list