IT Community - Software Programming, Web Development and Technical Support

sort record by alter statement

This is a discussion on sort record by alter statement within the Database Support forums, part of the Web Development category; Hi, here we have sorted bundle of records by alter stement. Alter statement use to enable which column should be ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-31-2008, 12: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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-31-2008, 02:54 AM
kumaresan kumaresan is offline
D-Web Trainee
 
Join Date: Jul 2007
Posts: 12
kumaresan is on a distinguished road
Send a message via AIM to kumaresan Send a message via Yahoo to kumaresan
Default Re: sort record by alter statement

hi prasath,

Error occurred while executing this query
Code:
ALTER TABLE check_orderby DROP ORDER BY id1;
__________________
Thanks,
v.kumarasan@gmail.com
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-31-2008, 02:55 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Cool Re: sort record by alter statement

Hi kumaresan,
i have wrongly pasted the code.
u can use
ALTER TABLE check_orderby ORDER BY id1;

its working fine.

Thanks,
Prasath the great.
__________________
Prasath.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort Datatable oxygen C# Programming 2 04-22-2008 09:25 PM
How can we sort the values in dataset? mobilegeek C# Programming 4 04-18-2008 03:39 AM
How to sort object array? raja C# Programming 4 03-14-2008 08:52 PM
Can I get javascript to determine a browsers font setting and alter srikumar_l HTML, CSS and Javascript Coding Techniques 0 11-21-2007 09:28 PM
Oracle Cluster - Create and Alter Basic Syntax Murali Database Support 2 07-11-2007 05:40 AM


All times are GMT -7. The time now is 10:46 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0