ORDER BY COLUMN 0

  • Thread starter Thread starter Florian Zimmermann
  • Start date Start date
F

Florian Zimmermann

Hello,

is there some functionality like ORDEr BY COLUMN 0 in access/t-sql to
specify the column for that should be ordered by number and not by
name/alias? I did search a bit and only found samples with field names to be
valid but want to be sure that is true.

Thanks

Florian
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yes you can order by the ordinal number of the column in the SELECT
clause. E.g.:

SELECT field1, field2, field3
FROM ...
ORDER BY 3

This will order the result set by "field3."


MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQA79voechKqOuFEgEQJtoACgzPIioq7tzI/4aWGWBiXq7/FX8YEAn3AZ
aKC6uEbDdMdj+ebZ9XLuGLwd
=IGdE
-----END PGP SIGNATURE-----
 
Thanks for the quick response. My first attemp was with order by 0 where I
should have used 1 as the first field number.

Florian
 
Back
Top