Insert row
am 09.02.2006 20:55:00 von CAH
Insert row beteewn to old rows. I have a database and I need a certain
order of the rows, and would like to insert a row between tod old rows.
Can that be done?
I use phpmyadmin and i belive i once saw such a feature, but I can't
find it now.
(I know your not supposed to use the order in the database)
C
Re: Insert row
am 09.02.2006 21:03:32 von Jonathan
madsgormlarsen@gmail.com wrote:
> Insert row beteewn to old rows. I have a database and I need a certain
> order of the rows, and would like to insert a row between tod old rows.
> Can that be done?
>
> I use phpmyadmin and i belive i once saw such a feature, but I can't
> find it now.
>
> (I know your not supposed to use the order in the database)
>
> C
>
If there is a index column using auto-increment it will be hard to
insert the record in between as MySQL interferes, if there is no
auto-increment column, it should be possible to insert using a
self-assigned id in your insert statement.
Jonathan
NB Did you forget to backup your data?
Re: Insert row
am 09.02.2006 21:45:11 von Bill Karwin
wrote in message
news:1139514900.317676.149280@g14g2000cwa.googlegroups.com.. .
> Insert row beteewn to old rows. I have a database and I need a certain
> order of the rows, and would like to insert a row between tod old rows.
> Can that be done?
The only ordering between records in a table is by the values in them. To
insert a record between two others, you must specifying a value that is
between the values in the same column in the other two records. Then ORDER
BY that column when you query the records back out. That's what you can do.
Regards,
Bill K.