Re: Select a column that is not in the order-clause ?
Posted in 1998
Bernhard Derix wrote:
>
> Is this possible ?
> I'd like to sth. like this:
>
> select columnY
> from (select *
> from tableXY
> order by columnX);>
> But this syntax isn't possible.
>
> I know it's possible through a view, but I don't want to use this.
>
> --
> Bernhard Derix
> email: derix@forwiss.uni-passau.de
> Homepage: http://www.forwiss.uni-passau.de/~derix/
> Universitaet Passau, FORWISS, Zi. FMI 034, Innstr. 33, 94032 Passau
> Tel.: 0851/509-3144
You can order by into a temp table and then select from there. Of
course, all bets are off on what order you get if you don't specify
exactly what you want in the final ORDER BY clause. Remember, SQL is
based on the maths of sets (well, except for ORDER BY).
Or you could use a database that takes SQL-92 support more seriously,
like IBM's DB2 :-).
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
Mail: Peter.Lancashire.PL1@bayer.co.uk
---
My Internet plumbing does not allow me to mail and post news together.
Sorry.
All opinions are my own and not those of Bayer plc.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/