naath: (Default)
[personal profile] naath
Died on this day in 1364 aged 44 King John II of France (my toy,wikipedia). Grandfather of Joan of Navarre who married Henry IV. Created the Franc (to pay off a ransom)

Born on this day in 1818 to Duke Friedrich of Schleswig-Holstein-Sonderburg-Gucksburg and Princess Louise of Hesse-Kassel, King Christian IX of Denmark (my toy,wikipedia). Father of Alexandra who married Edward VII. Married his second cousin and then married their children into royal families across Europe making him an ancestor of most current European monarch (I'm not sure what % of monarchs in 1818 would share that distinction... and interesting question, but one I don't have time to turn into SQL right now).

An SQL question - can I write a thing that makes SORT BY sort in some custom order? Or do I need to give the things numbers (bit of a hack?). I want to sort by title and have it come out starting Emperor, then King, then Duke, etc. rather than alphabetically.

(no subject)

Date: 2015-04-08 09:48 pm (UTC)
emperor: (Default)
From: [personal profile] emperor
You could write a stored procedure that knew about the ordering (I think), or have a table of rank,order and JOIN that with your query and then ORDER BY the relevant column.

The postgres wiki has a suggestion, too: http://wiki.postgresql.org/wiki/Array_Index
Edited Date: 2015-04-08 09:50 pm (UTC)

Profile

naath: (Default)
naath

December 2022

S M T W T F S
    123
45678 910
11121314151617
18192021222324
25262728293031

Style Credit

Expand Cut Tags

No cut tags