Daniel Feiglin wrote:
Hello folks!
I have a problem with SQL for MySQL (and pre4sumably any other kind):
Can anone offer a RTFM do do something like this:
create table foo ( boo int, bar varchar; baz array[0..9] of int, # illegal, but needed! ... );
I'm not really thrilled about stuffing all the data into a blob or a varchar and using c/c++/whatever text handling.
Some questions: 1. Do you always have exactly 10 integers in baz? 2. Does their order in baz matter? 3. Is a value in baz constrained to appear exactly once?
At any case:
Why not normalize the table into two tables (I am making here the guess that boo is the only key):
create table foo_bar (
boo int, # This is the key
bar varchar); create table foo_baz (
boo int, # This is the key
baz int);If duplicates are allowed in baz, then add to foo_baz another field:
baz_count int
which will count the number of appearances of the value in question.
But if their order is important, add:
serial int
which will keep track of the order of the values.--- Omer My own blog is at http://www.livejournal.com/users/tddpirate/
My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
