468,535 Members | 1,736 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,535 developers. It's quick & easy.

Greek Alphabet Ordering

Got a tough one here for you SQL junkies.

I'm working on a website (in ASP) for a national greek/college
organization. All it's college chapters have greek chapter names,
i.e. Alpha Chapter, Delta Chapter, Delta Iota Chapter, Gamma Phi
Chapter, ect. ect.

I need the SQL to return the chapters in greek alphabet ordering. See
below:
1. Alpha
2. Beta
3. Gamma
4. Delta
5. Epsilon
6. Zeta
7. Eta
8. Theta
9. Iota
10. Kappa
11. Lambda
12. Mu
13. Nu
14. Xi
15. Omicron
16. Pi
17. Rho
18. Sigma
19. Tau
20. Upsilon
21. Phi
22. Chi
23. Psi
24. Omega

Basically I need a way to specify this type of presedence for wording
and keep all the results in greek-letter order, so Sigma Upsilon comes
before Sigma Tau, and so on.

Also, to make it even more difficult, these are written words, not the
actual greek symbols like α β etc. Everything is stored in
the DB as Alpha Beta Whateva Chapter.

Hopefully some of you SQL junkies will be able to help on this one ;)
Jul 20 '05 #1
2 4769
Create a table with the required mapping, i.e the greek letter and its
precedence.

CREATE TABLE Mappings (
Greek VARCHAR(10) NOT NULL,
Precedence INT NOT NULL PRIMARY KEY) ;

Now, you can use this table in your queries with a join on the Greek column
& then sort the resultset by precedence.

SELECT *
FROM tbl
INNER JOIN Mappings
ON tbl.Greekletter = Mappings.Greek
ORDER BY Mappings.Precedence ;

--
- Anith
( Please reply to newsgroups only )
Jul 20 '05 #2
I'm pretty sure that this won't work. I believe it assumes that the
field name consists only of one greek letter, and that the precendence
(sort_order) will be matched along with the mapping letter by letter
for each record in the column. This would have been great, except the
records in the CHAPTERS table are more like: 'Gamma Rho Chapter', 'Xi
Chapter', 'Sigma Epsilon Chapter', ect.

I do appreciate the attempt though.

"Anith Sen" <an***@bizdatasolutions.com> wrote in message news:<T8*********************@bgtnsc04-news.ops.worldnet.att.net>...
Create a table with the required mapping, i.e the greek letter and its
precedence.

CREATE TABLE Mappings (
Greek VARCHAR(10) NOT NULL,
Precedence INT NOT NULL PRIMARY KEY) ;

Now, you can use this table in your queries with a join on the Greek column
& then sort the resultset by precedence.

SELECT *
FROM tbl
INNER JOIN Mappings
ON tbl.Greekletter = Mappings.Greek
ORDER BY Mappings.Precedence ;

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by sharma | last post: by
27 posts views Thread by alexdoulou | last post: by
9 posts views Thread by PAN | last post: by
4 posts views Thread by Kiki | last post: by
5 posts views Thread by Stefan Krah | last post: by
1 post views Thread by interuser | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.