Solved

SQL: order by amount of characters within a field

Posted on 2004-09-30
1
228 Views
Last Modified: 2006-11-17
Hi,

I have a competition message. I want to create a new table using query analyser using an SQL statement.

It shoud sort the competition message from shortest length to greatest length.

I am using to do this in SQL and only ASP as a last resort.

Thanks, tp
0
Comment
Question by:tippingpoint
1 Comment
 
LVL 10

Accepted Solution

by:
m8rix earned 500 total points
ID: 12196597
From my understanding, I think this is what you are trying to do.

SELECT CommentField, OtherField1, OtherField2, OtherField3 INTO NewTable
FROM YourTable
ORDER BY Len([CommentField]);
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question