Insert row

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • madsgormlarsen@gmail.com

    #1

    Insert row

    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

  • Jonathan

    #2
    Re: Insert row

    madsgormlarsen@ gmail.com wrote:[color=blue]
    > 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
    >[/color]

    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?

    Comment

    • Bill Karwin

      #3
      Re: Insert row

      <madsgormlarsen @gmail.com> wrote in message
      news:1139514900 .317676.149280@ g14g2000cwa.goo glegroups.com.. .[color=blue]
      > 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?[/color]

      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.


      Comment

      Working...