How can I order a result set by a special order of a column. For example, let's say I have this query SELECT * FROM subcampo sc JOIN campo c ON (c.codigo = sc.campo) WHERE c.etiqueta IN (245, 130, 240, 243, 246, 490, 630, 730, 740) Now I want to order the result set using c.etiqueta but with the order of the values as you see in the IN clause. How can I do that? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general