Can || be used in ORDER BY?

From: "Jeremy Malcolm" <Jeremy(at)Malcolm(dot)wattle(dot)id(dot)au>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Can || be used in ORDER BY?
Date: 2000-01-26 01:28:42
Message-ID: NDBBKJLCGDKIONEINKJAKEMACDAA.Jeremy@Malcolm.wattle.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----

I would like to do this:

select
field1,field2
from tablename
order by (field1||'-top')

ie. order the records by the contents of field1 with the text "-top"
concatenated to it. It doesn't work, I get a parse error.

Can anyone offer advice?

Thanks.

- --
JEREMY MALCOLM Jeremy(at)Malcolm(dot)wattle(dot)id(dot)au http://malcolm.wattle.id.au
SIG of the day: [ ] Contact [ ] Web [ ] PGP [ ] Taglines #1 [x] #2
"I'm a lawyer." "Honest?" "No, the usual kind." | Linux, the choice of
a GNU generation. | Are you the brain specialist? | "Could anyone pass
the sodium chloride, please?" - Adric (5W) | The Nanites have lawyers?

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.0.2i

iQB1AwUBOI3a6L/mBljD2JABAQG3RQL8DxUkukKGm7jEa9rSgyFzXMcd5KJejRxU
abscA8SuVq7ENXdFncx+5OsAk0VQfzBkUkRlobD9LEFXm6aTsK2zqmlhdVsJFKyh
f/YOixdaGiNzE+9xfIpEz+iizzKBwPRy
=bED8
-----END PGP SIGNATURE-----

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Mount 2000-01-26 01:50:43 Re: [GENERAL] JDBC 2.0
Previous Message John Henderson 2000-01-26 00:34:10 Re: Is this a bug