If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
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?
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
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
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...