View Single Post
  #1 (permalink)  
Old 03-31-2008, 01:22 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Smile sort record by alter statement

Hi,
here we have sorted bundle of records by alter stement.
Alter statement use to enable which column should be sorted the records.
Refer below code:
CREATE TABLE check_orderby
(id INTEGER,
id1 INTEGER,
val FLOAT(10,2)
)ENGINE=MyISAM;
INSERT INTO check_orderby VALUES(1,1,10.50);
INSERT INTO check_orderby VALUES(1,3,10.50);
INSERT INTO check_orderby VALUES(1,2,10.50);
INSERT INTO check_orderby VALUES(1,5,10.50);
INSERT INTO check_orderby VALUES(1,4,10.50);
COMMIT;
ALTER TABLE check_orderby DROP ORDER BY id1;
SELECT * FROM check_orderby;
+------+------+-------+
| id | id1 | val |
+------+------+-------+
| 1 | 1 | 10.50 |
| 1 | 2 | 10.50 |
| 1 | 3 | 10.50 |
| 1 | 4 | 10.50 |
| 1 | 5 | 10.50 |
+------+------+-------+
Thanks,
Prasath the great.
__________________
Prasath.K
Reply With Quote
Sponsored Links