Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
Order By in Sql [its an Urgent]
December 04, 2008
i want to sort some column in table!
How i am doing:-
Select * from tablename Order By columnName
This gives me right data
But Problem is Here?????
It not change in actual table data, that query only shows temporary view..?
So can any one please help me How this query change my actual table column field as showing in temporary view.
Posted Date: December 04, 2008 Points: 5
I dont know why you need this when you can sort into client side or using order by clause. but try like this
1) Insert all the data into temp table
2) delete the existing data
3) insert again the the data stored in temp table into the original Table using order by command in temp table.
Hope this helps
Mark As Answer
" if this post help you.
Posted Date: December 07, 2008 Points: 5
Hello sir, Please try with code,
First Run this Query,
1. Select * into tablenameNew from tablename where 1>2;
This query is created new table, where tablenameNew=NewTableName ane tablename=OldTableName.
2. insert into tablenameNew select distinct * from tablename order by ColumnName;
This Query is Copy the Data from tablename and Paste in tablenameNew.
Shashi Kant Ray
To post reply
Related Questions Related Questions
Urgent datagridview edit updated rows C#.NET
Datagridviewtextcolumn in C#.NET windows app urgent
Doubt in popup window.Urgent requirement
urgent help in oops
Problem in writing unit test cases in vs 2008 for a webapplication(please its urgent)
hi very urgent requirement
order of validation controls in asp.net
How do I change the DataGrid column order programmatically?
Latest Forum Questions From The Same Category
Help to get SQL output
how to restore my sql database from my hosting provider?
SQL query to update date range
Add allowance to employee table is wrong or true according to my case
how to remove trailing zeroes in a decimal in sql server
Required Union All Result in two different column
Sql Multiple table data retrival
Table Translation records
How select huge Data from sql without take long time?
Passing using parameter in store procedure get the top3 record from the table
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend