Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread ORDER BY on alphameric column
Wed, Jun 1 2011 12:00 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

I thought a new thread was in order. Here's an example it'll work on up to 6 alpha's preceding the number

select
CAST(
SUBSTR(_Page,
CASE
WHEN SUBSTR(_Page,1,1) >='0' AND SUBSTR(_Page,1,1) <='9' THEN 1
WHEN SUBSTR(_Page,2,1) >='0' AND SUBSTR(_Page,2,1) <='9' THEN 2
WHEN SUBSTR(_Page,3,1) >='0' AND SUBSTR(_Page,3,1) <='9' THEN 3
WHEN SUBSTR(_Page,4,1) >='0' AND SUBSTR(_Page,4,1) <='9' THEN 4
WHEN SUBSTR(_Page,5,1) >='0' AND SUBSTR(_Page,5,1) <='9' THEN 5
WHEN SUBSTR(_Page,6,1) >='0' AND SUBSTR(_Page,6,1) <='9' THEN 6
ELSE 9999
END
,999)+'0'
AS INTEGER)
AS FRED

,
*

from contents
where _Page <> ''
and _id < 10

Roy Lambert
Image