>>>>> "Marco" == Marco Becchio <becks@stripped> writes:
Marco> What about a table like this?
Marco> | matrix |
Marco> | matrixrow | INT
Marco> | matrixcolumn | INT
Marco> One table row for each non-zero matrix cell.
Marco> to get the cell value you could do: select count(*) from matrix where
Marco> matrixrow=.... and matrixcol=....
Hi Marco, thanks for your fast answer. I understand this, and it does
solve the problem I stated.
Unfortunately, I now see that I described something a little simpler
than what I actualy need to do. Here's my actual situation.
I have a column in a table that holds ID numbers. The rest of the
columns indicate properties that can either be 1 or 0. If you think of
the ID numbers as representing objects, I want to be able to ask
questions such "select all the objects that have property 12 and do
not have property 17".
With a table containing the 1's and 0's, I can do this easily.
With a representation like yours, I don't see how to do it because I
want to select on things that are not in the table (i.e., not having a
property). In your representation I could use my object IDs as your
matrixrow and my property (column) number as your matrixcolumn. That
would allow me to select all the IDs that did have some set of
properties, but not ask a question with a negative term like the
Perhaps there is something in SQL that will let me do this. I know
almost nothing about SQL (as well as knowing nothing about databases).
Sorry for the confusion, and thanks for your original help. I think I
have stated things clearly now.