Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

alphanumeric sort on inconsistent values
I am running SQL Server 2000 and must sort on an alphanumeric field.  There
is no pattern consistency for the values in the column (let's call it FILENU
M
varchar(30)).  I am having a difficult time coming up with a solution.

Given a set of filenumbers:

1dd
1
1x4
1cc2
1110-345-720a3
11
380-41-3a
10

Should be sorted as:

1
1cc2
1dd
1x4
10
11
380-41-3a
1110-345-720a3

any assistance would be greatly appreciated.


Thanks,
Tracy

Report this thread to moderator Post Follow-up to this message
Old Post
Tracy R via webservertalk.com
09-01-05 01:23 AM


RE: alphanumeric sort on inconsistent values
assuming the name of your table is table1, you can execute the following que
ry:

select * from table1 order by ascii(filenum)

"Tracy R via webservertalk.com" wrote:

> I am running SQL Server 2000 and must sort on an alphanumeric field.  Ther
e
> is no pattern consistency for the values in the column (let's call it FILE
NUM
> varchar(30)).  I am having a difficult time coming up with a solution.
>
> Given a set of filenumbers:
>
> 1dd
> 1
> 1x4
> 1cc2
> 1110-345-720a3
> 11
> 380-41-3a
> 10
>
> Should be sorted as:
>
> 1
> 1cc2
> 1dd
> 1x4
> 10
> 11
> 380-41-3a
> 1110-345-720a3
>
> any assistance would be greatly appreciated.
>
>
> Thanks,
> Tracy
>

Report this thread to moderator Post Follow-up to this message
Old Post
RGA
09-01-05 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 02:24 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006