Results 1 to 4 of 4

Thread: insert

  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Question Unanswered: insert

    Hi
    The key field in my database table is a VARCHAR.
    When I insert into the table, the records are inserted automatically to the beginning of the table. How can I change this so they are inserted to the end?

  2. #2
    Join Date
    Sep 2002
    Location
    Montreal, Canada
    Posts
    224
    Provided Answers: 1

    Re: insert

    Originally posted by Nora
    Hi
    The key field in my database table is a VARCHAR.
    When I insert into the table, the records are inserted automatically to the beginning of the table. How can I change this so they are inserted to the end?
    There is no such thing as "inserted at the end" or "inserted at the beginning" ! Data is stored in B+ trees! If you want to retrieve your data in a particular order, us ORDER BY with your SELECT

  3. #3
    Join Date
    Nov 2003
    Posts
    2
    The thing is, I can´t really do an order by
    I want to select the first record inserted into the table (which will be the last record)
    So, what I want to know is if I am able to write a query to select the last record in a table?
    Thanks

  4. #4
    Join Date
    Sep 2002
    Location
    Montreal, Canada
    Posts
    224
    Provided Answers: 1
    Originally posted by Nora
    The thing is, I can´t really do an order by
    I want to select the first record inserted into the table (which will be the last record)
    So, what I want to know is if I am able to write a query to select the last record in a table?
    Thanks
    Well, the only way to know which record is first or last would be to have a timestamp or auto_increment column in that table... That way you could select MIN and MAX on that column...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •