Re: Re: Auto_increment field size (was: Howto make a double LEFT JOIN)
| From: | Sheridan Saint-Michel | Date: | Fri, 05 Oct 2001 18:44:29 +0000 |
| Subject: | Re: Re: Auto_increment field size (was: Howto make a double LEFT JOIN) | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70130@lists.php.net to get a copy of this message | ||
Andrey: What is this select supposed to do? I fail to see how this would
help a person who has hit max_size on an auto_increment field.
Bas: The other alternative that would be to occasionally update sid for all
the rows, reseting them to 1,2,3,etc. You could do that with the following:
set @variable=0;
update table1 set sid=(@variable:=@variable+1);
select sid from table1;
alter table table1 auto_increment=#;
The select is so that you can see what the last sid value is and replace #
with it + 1. Unfortunately both set_index and alter table table1
auto_increment will only accept numbers so you can't use @variable+1 here.
Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com
----- Original Message -----
From: "Andrey Hristov" <ahristov@icygen.com>
To: <php-general@lists.php.net>
Sent: Friday, October 05, 2001 11:04 AM
Subject: [PHP] Re: [PHP-DB] Auto_increment field size (was: Howto make a
double LEFT JOIN)
> select first.*,second.*,third.* from first left join second
> using(for_key_first_second) left join third using(for_key_2_3);
>
> On Friday 05 October 2001 18:50, you wrote:
> > Hello,
> >
> > > you can always reset the auto_increment value (I think that is as
simlple
> >
> > as
> >
> > > "set insert_id=1;" but you may want to double check as this is off the
> > > top of my head).
> >
> > I don't think i can do so cause i never delete all rows.
> > so will get something like:
> > 1
> > <- new insert her
> > 10000000
> > 10000001
> > etc.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net