Andreas Gaab <A.Gaab@scanlab.de> writes:
> I tried to order a text-column only by parts of the entries. Therefore I used regexp_matches(), but unfortunately I
amloosing rows.
> SELECT regexp_matches('abc','[0-9]+'), regexp_matches('123','[0-9]+');
> Does not return "{null}, {123}" but no result at all.
Yes, because regexp_matches returns a rowset of zero or more results.
The fine manual suggests putting it in a sub-select if what you want
is a null or a single result:
SELECT ... , (SELECT regexp_matches(...)) FROM ...
regards, tom lane