ID order...
Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: ID order...
Yes it is a strange question.. MySQL result sets are in the order you asked in the query. IF you would like the result set to be in order by a field called ID then just add order by ID at the end of your query.. Is this what you were asking? If not , can you give more insights of what the query was returning before the deletion, and what it is returning now and what you'd like it to return? Thanks, Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:23 AM To: mysql lists.mysql.com Subject: ID order... Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ID order...
Maybe. Just I have delete let say ID 63, 64 and when I added 74,75. They are place into the slot where 63, 64 were. So I read this in the ID list 61,62, 74, 75, 66, 67... I am trying to understand why it's placing 74 and 75 in the slots that were deleted. Is there a re-index command that will place them into the right order. Chuck on 3/19/02 1:00 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Yes it is a strange question.. MySQL result sets are in the order you asked in the query. IF you would like the result set to be in order by a field called ID then just add order by ID at the end of your query.. Is this what you were asking? If not , can you give more insights of what the query was returning before the deletion, and what it is returning now and what you'd like it to return? Thanks, Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:23 AM To: mysql lists.mysql.com Subject: ID order... Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ID order...
Ok, here is a copy of my database and you will see what I am talking about... | 55 | j| programming | http://webdeveloper.earthweb.com/pagedev/webjs | Javascripts.com| | 56 | h| webdesign | http://www.htmlgoodies.com | HTML Goodies | | 57 | l| linux | http://lwn.net | Linux Weekly News | | 58 | l| linux | http://www.linuxstart.com | Linux Start| | 74 | b| beos| http://www.beosonline.com/index.php?seite=english | BeOS Online German Site | | 75 | b| beos| http://www.blueos.free.fr | BlueOS | | 62 | s| graphics| http://www.steeldolphin.com | Steel Dolphin Creative | | 63 | w| graphics| http://www.wacom.com/tips | Wacom Photoshop Tips...| | 64 | d| graphics| http://www.dvpa.org | Digital Video Prof. Assoc. | | 73 | o| beos| http://open-beos.sourceforge.net | Open BeOS | | 66 | p| graphics| http://www.photoshopcertification.com | NAPP's Practice Certification Exam | | 67 | d| graphics| http://deezin.com/ | The Graphic Design Resource Center | | 68 | p| graphics| http://www.photoshopseminars.com | Adobe Photoshop Seminar Tour...| | 69 | p| graphics| http://www.photoshopcafe.com | Photoshop Cafe | I deleted 59, 60, 61, 65. MySQL place 74 into 59 slot, 75 into 60, and 73 into 65. The SQL state I did was Select * from table_name; Just a simple command. So again why is it filling the deleted slot? Chuck on 3/19/02 1:00 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Yes it is a strange question.. MySQL result sets are in the order you asked in the query. IF you would like the result set to be in order by a field called ID then just add order by ID at the end of your query.. Is this what you were asking? If not , can you give more insights of what the query was returning before the deletion, and what it is returning now and what you'd like it to return? Thanks, Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:23 AM To: mysql lists.mysql.com Subject: ID order... Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: ID order...
Hi, Just add order by ID in your query it will give you the results in the way you'd like... Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 1:17 AM To: Gurhan Ozen; mysql lists.mysql.com Subject: Re: ID order... Ok, here is a copy of my database and you will see what I am talking about... | 55 | j| programming | http://webdeveloper.earthweb.com/pagedev/webjs | Javascripts.com| | 56 | h| webdesign | http://www.htmlgoodies.com | HTML Goodies | | 57 | l| linux | http://lwn.net | Linux Weekly News | | 58 | l| linux | http://www.linuxstart.com | Linux Start| | 74 | b| beos| http://www.beosonline.com/index.php?seite=english | BeOS Online German Site | | 75 | b| beos| http://www.blueos.free.fr | BlueOS | | 62 | s| graphics| http://www.steeldolphin.com | Steel Dolphin Creative | | 63 | w| graphics| http://www.wacom.com/tips | Wacom Photoshop Tips...| | 64 | d| graphics| http://www.dvpa.org | Digital Video Prof. Assoc. | | 73 | o| beos| http://open-beos.sourceforge.net | Open BeOS | | 66 | p| graphics| http://www.photoshopcertification.com | NAPP's Practice Certification Exam | | 67 | d| graphics| http://deezin.com/ | The Graphic Design Resource Center | | 68 | p| graphics| http://www.photoshopseminars.com | Adobe Photoshop Seminar Tour...| | 69 | p| graphics| http://www.photoshopcafe.com | Photoshop Cafe | I deleted 59, 60, 61, 65. MySQL place 74 into 59 slot, 75 into 60, and 73 into 65. The SQL state I did was Select * from table_name; Just a simple command. So again why is it filling the deleted slot? Chuck on 3/19/02 1:00 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Yes it is a strange question.. MySQL result sets are in the order you asked in the query. IF you would like the result set to be in order by a field called ID then just add order by ID at the end of your query.. Is this what you were asking? If not , can you give more insights of what the query was returning before the deletion, and what it is returning now and what you'd like it to return? Thanks, Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:23 AM To: mysql lists.mysql.com Subject: ID order... Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ID order...
Ok, but that still doesn't any why MySQL is filling the delete slot, I understand that I can do any SQL statement to put into the order I want. I guess what I am trying to wonder how it place a record into the table, does MySQL see that the slot is empty and then fills it with a new record? Chuck on 3/19/02 1:20 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Hi, Just add order by ID in your query it will give you the results in the way you'd like... Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 1:17 AM To: Gurhan Ozen; mysql lists.mysql.com Subject: Re: ID order... Ok, here is a copy of my database and you will see what I am talking about... | 55 | j| programming | http://webdeveloper.earthweb.com/pagedev/webjs | Javascripts.com| | 56 | h| webdesign | http://www.htmlgoodies.com | HTML Goodies | | 57 | l| linux | http://lwn.net | Linux Weekly News | | 58 | l| linux | http://www.linuxstart.com | Linux Start| | 74 | b| beos| http://www.beosonline.com/index.php?seite=english | BeOS Online German Site | | 75 | b| beos| http://www.blueos.free.fr | BlueOS | | 62 | s| graphics| http://www.steeldolphin.com | Steel Dolphin Creative | | 63 | w| graphics| http://www.wacom.com/tips | Wacom Photoshop Tips...| | 64 | d| graphics| http://www.dvpa.org | Digital Video Prof. Assoc. | | 73 | o| beos| http://open-beos.sourceforge.net | Open BeOS | | 66 | p| graphics| http://www.photoshopcertification.com | NAPP's Practice Certification Exam | | 67 | d| graphics| http://deezin.com/ | The Graphic Design Resource Center | | 68 | p| graphics| http://www.photoshopseminars.com | Adobe Photoshop Seminar Tour...| | 69 | p| graphics| http://www.photoshopcafe.com | Photoshop Cafe | I deleted 59, 60, 61, 65. MySQL place 74 into 59 slot, 75 into 60, and 73 into 65. The SQL state I did was Select * from table_name; Just a simple command. So again why is it filling the deleted slot? Chuck on 3/19/02 1:00 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Yes it is a strange question.. MySQL result sets are in the order you asked in the query. IF you would like the result set to be in order by a field called ID then just add order by ID at the end of your query.. Is this what you were asking? If not , can you give more insights of what the query was returning before the deletion, and what it is returning now and what you'd like it to return? Thanks, Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:23 AM To: mysql lists.mysql.com Subject: ID order... Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: ID order...
ugh..I guess that would be a question for the developers:) I don't know the answer to that question.. Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 1:24 AM To: Gurhan Ozen; [EMAIL PROTECTED] Subject: Re: ID order... Ok, but that still doesn't any why MySQL is filling the delete slot, I understand that I can do any SQL statement to put into the order I want. I guess what I am trying to wonder how it place a record into the table, does MySQL see that the slot is empty and then fills it with a new record? Chuck on 3/19/02 1:20 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Hi, Just add order by ID in your query it will give you the results in the way you'd like... Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 1:17 AM To: Gurhan Ozen; mysql lists.mysql.com Subject: Re: ID order... Ok, here is a copy of my database and you will see what I am talking about... | 55 | j| programming | http://webdeveloper.earthweb.com/pagedev/webjs | Javascripts.com| | 56 | h| webdesign | http://www.htmlgoodies.com | HTML Goodies | | 57 | l| linux | http://lwn.net | Linux Weekly News | | 58 | l| linux | http://www.linuxstart.com | Linux Start| | 74 | b| beos| http://www.beosonline.com/index.php?seite=english | BeOS Online German Site | | 75 | b| beos| http://www.blueos.free.fr | BlueOS | | 62 | s| graphics| http://www.steeldolphin.com | Steel Dolphin Creative | | 63 | w| graphics| http://www.wacom.com/tips | Wacom Photoshop Tips...| | 64 | d| graphics| http://www.dvpa.org | Digital Video Prof. Assoc. | | 73 | o| beos| http://open-beos.sourceforge.net | Open BeOS | | 66 | p| graphics| http://www.photoshopcertification.com | NAPP's Practice Certification Exam | | 67 | d| graphics| http://deezin.com/ | The Graphic Design Resource Center | | 68 | p| graphics| http://www.photoshopseminars.com | Adobe Photoshop Seminar Tour...| | 69 | p| graphics| http://www.photoshopcafe.com | Photoshop Cafe | I deleted 59, 60, 61, 65. MySQL place 74 into 59 slot, 75 into 60, and 73 into 65. The SQL state I did was Select * from table_name; Just a simple command. So again why is it filling the deleted slot? Chuck on 3/19/02 1:00 AM, Gurhan Ozen at [EMAIL PROTECTED] wrote: Yes it is a strange question.. MySQL result sets are in the order you asked in the query. IF you would like the result set to be in order by a field called ID then just add order by ID at the end of your query.. Is this what you were asking? If not , can you give more insights of what the query was returning before the deletion, and what it is returning now and what you'd like it to return? Thanks, Gurhan -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 12:23 AM To: mysql lists.mysql.com Subject: ID order... Ok, strange question. I have delete some records and I have notice that ID's are no longer in order when I do a SQL statement. Why is that? What can I do put the records back into order? | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php
Re: ID order...
On Tue, Mar 19, 2002 at 01:24:06AM -0500, Chuck PUP Payne wrote: Ok, but that still doesn't any why MySQL is filling the delete slot, I understand that I can do any SQL statement to put into the order I want. I guess what I am trying to wonder how it place a record into the table, does MySQL see that the slot is empty and then fills it with a new record? Yes. -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.47-max: up 39 days, processed 1,168,909,965 queries (340/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ID order...
Hi, On Tue, 2002-03-19 at 16:24, Chuck PUP Payne wrote: Ok, but that still doesn't any why MySQL is filling the delete slot, I understand that I can do any SQL statement to put into the order I want. I guess what I am trying to wonder how it place a record into the table, does MySQL see that the slot is empty and then fills it with a new record? Yes. According to the SQL specs, the order of the result set is undefined. If you want it ordered, you have to specify it (ORDER BY). The fact that it often looks ordered until you delete/insert is pure coincidence and should not be relied upon. It depends entirely on the storage mechanism used, something which is no business of the application. Just do an ORDER BY if you need it ordered. The server is bright enough not to order if it is not required, or use an index to order if possible. Trust the optimiser, and don't assume anything about ordering. Regards, Arjen. -- Get MySQL Training Worldwide, http://www.mysql.com/training/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Arjen G. Lentz [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Technical Writer, Trainer /_/ /_/\_, /___/\___\_\___/ Brisbane, QLD Australia ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php