These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

Out of Pod Experience

 
  • Topic is locked indefinitely.
 

Database sorting

Author
Myfanwy Heimdal
Heimdal Freight and Manufacture Inc
#1 - 2011-09-26 13:26:53 UTC
I was looking to see how I could sort of the British race meeting names properly. For example Ffos Las should come after Folkestone in the ratings; this is because 'ff' is a digraph letter which follows 'f'.

One would have thought that is possible but, no, I can sort in ruddy Klingon but not in Welsh which, one would have thought, be mildly more useful.

The world hss gone mad.

Pam:  I wonder what my name means in Welsh?Nessa: Why?

SpaceSquirrels
#2 - 2011-09-26 16:24:27 UTC
Which language? SQL?
Myfanwy Heimdal
Heimdal Freight and Manufacture Inc
#3 - 2011-09-26 17:00:17 UTC
That would do fro starters but I am going to it A Different Way. But, who goes out of their way to make something which works with Klingon? It's not as if it were ever a brilliant series (MH says going off topic).

Pam:  I wonder what my name means in Welsh?Nessa: Why?

Taedrin
Federal Navy Academy
Gallente Federation
#4 - 2011-09-27 00:09:10 UTC
Most programming languages allow you to sort on customizeable datatypes. Simply create a new string like data type which implements the compare function used by your favorite comparison sorting algorithm. Construct your customized compare function to follow whatever sorting rules you want it to.
stoicfaux
#5 - 2011-09-27 06:04:50 UTC
If two characters are being used to represent one, then how is the sorting routine/database driver/software going to accurately determine when "ff" represents one character or when it represents two chars (such as in the word "suffering"?) The sorting routine would need to do context sensitive translation, which is a bit much to ask.

In other words, the data needed to sort accurately isn't there. You'll probably need to get a "proper" data set that uses unicode characters for your Welsh digraphs in order to sort properly.

Pon Farr Memorial: once every 7 years, all the carebears in high-sec must PvP or they will be temp-banned.

Lutz Major
Austriae Est Imperare Orbi Universo
#6 - 2011-09-27 07:25:07 UTC
Each database has sorting algorithms based on languages.

In Oracle you can use ... ORDER BY NLSSORT(LASTNAME, 'NLS_SORT = GERMAN'), which sorts Böck before Bocka. Otherwise the 'ö' would be sorted at the end.

In MySQL it's the collation (IIRC).


If there is no build-in pack for your language, google one or create one of your own.


Or you do it code-wise, like already suggested, with comparators.