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.

 
Go Back  dBforums > Database Server Software > MySQL > insert

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-03, 10:17
Nora Nora is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Question 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?
Reply With Quote
  #2 (permalink)  
Old 11-11-03, 10:48
bstjean bstjean is offline
Registered User
 
Join Date: Sep 2002
Location: Montreal, Canada
Posts: 219
Re: insert

Quote:
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
Reply With Quote
  #3 (permalink)  
Old 11-11-03, 11:27
Nora Nora is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-11-03, 12:11
bstjean bstjean is offline
Registered User
 
Join Date: Sep 2002
Location: Montreal, Canada
Posts: 219
Quote:
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...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On