SELECT *
FROM table
ORDER BY CASE WHEN len(col) >= 2
THEN REPLACE(LEFT(COL, 1), '"', '')
+ RIGHT(LEFT(col, LEN(col)-1), LEN(LEFT(col, LEN(col)-1))-1)
+ REPLACE(RIGHT(col, 1), '"', '')
ELSE col
END
in the ORDER BY
, I eliminate double quotes by replacing it 'within' 1st & last characters by ''. Of course it's only valid when col length >= 2.
najmeddine
2009-09-17 16:48:32