Solved

SQL: order by amount of characters within a field

Posted on 2004-09-30
1
199 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now