On Wed, Sep 29, 2010 at 5:24 AM, clint <[email protected]> wrote:

> yeah, that's a little too obvious...
>
> it has a built-in assumption that doesn't apply to my data: that I do/
> can have exhaustive a priori knowledge of the set of values.
>

Well your request for help did say "I have a table that is about
months...names to be precise" and "all my incoming info is about the month
name" so I don't think the suggested solution was very presumptuous :-)


> So the numbers I'd have to use would need to be separated like 100,
> 200, 300 to begin with, so that I could place things in the middle at
> 150, 250, and then maybe 125, 275...
>

You can renumber the "month" table at any time. Nothing cares what the
numbers are, only the sequence. You could use the "table" idea, and also
create an alias to add new records. Something like the following
pseudo-code:

// Add a new "month" immediately after the existing month
int addMonthThing(String newMonth, String existingMonth) {

    select sequence_id into $existingSequence from month_table where month =
existingMonth

    if notfound {
         $existingSequence = 1;
    }

    update month_table set sequence_id = sequence_id + 1 where sequence_id >
$existingSequence

    insert into month_table(sequence_id, month_name) values
($existingSequence+1, newMonth)
}


Cheers
Kerry



> I'm pretty sure the complete set isn't more than 50-60 values, but I'm
> not absolutely sure. And new variations could appear at any time.
>
> So I kinda need to make an arbitrary list where I only have to
> maintain the sequence, not numbers.
>
>
>
>
> On Sep 27, 1:40 am, Rami Ojares <[email protected]> wrote:
> >   One way would be to use integers to represent the months
> > 1 = Jan, 2 = Feb ...
> >
> > - Rami
> >
> > On 27.9.2010 3:06, Clint Hyde wrote:
> >
> > > I have a table that is about months...names to be precise...which of
> > > course have
> >
> > > ascii_name_order != date_time_order
> >
> > > that said, all my incoming info is about the month name.
> >
> > > so I'd like to create a custom sort/collation order for this one
> > > column in this one table.
> >
> > > How do I do that?
> >
> > >  -- clint
> >
> > > ------
> >
> > > my db is close to going live for public consumption...I have ~ 1
> > > million records in it, text indexing is working properly (yay! thanks!)
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<h2-database%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to