Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ngquochung
Starting Member
13 Posts |
Posted - 2006-11-26 : 03:03:10
|
| How to sort elements in column in lexicographic order?Regards,H |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-26 : 03:24:12
|
| What do you exactly mean by lexicographic order?Do you mean case-sensitive order? for that you can use COLLATE clause in ORDER BY.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-26 : 23:52:57
|
quote: Originally posted by ngquochung How to sort elements in column in lexicographic order?Regards,H
Post some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-27 : 10:18:46
|
| [code]SELECT DISTINCT *FROM (SELECT 1 p UNION ALL SELECT 2 UNION ALL SELECT 3) b0CROSS JOIN (SELECT 1 p UNION ALL SELECT 2 UNION ALL SELECT 3) b1CROSS JOIN (SELECT 1 p UNION ALL SELECT 2 UNION ALL SELECT 3) b2WHERE b0.p <> b1.p AND b0.p <> b2.p AND b1.p <> b2.pORDER BY b0.p, b1.p, b2.p[/code]Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|