-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
CREATE TABLE something (
    title VARCHAR(50) NOT NULL PRIMARY KEY
);

INSERT INTO something VALUES('A');
INSERT INTO something VALUES('B');
INSERT INTO something VALUES('C');
INSERT INTO something VALUES(';');
INSERT INTO something VALUES('%');

SELECT title FROM something ORDER BY title;

SELECT title FROM something ORDER BY title COLLATE LATIN1_GENERAL_CI;

SELECT title FROM something ORDER BY title COLLATE LATIN1_DANISH_CI;

SELECT title FROM something ORDER BY title COLLATE LATIN1_BIN;

SELECT title FROM something ORDER BY title REGEXP '[A-Za-z].*' DESC, title;

DROP TABLE something;
