Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

How to order by a column index?

$
0
0

Hi there

The Pervasive 11 allows sorting with no reference to a column name, like:

select RecID, RecId, Description from SelfSchedGroups  order by 1

The clause above will order by the first column.

How accomplish that for the MS SQL 2012?

Simply put, I'm struggling with the column ambiguity for the clause, came from Pervasive:

 select RecID, RecId, Description from SelfSchedGroups  order by RecId

It is absolutely Ok for Pervasive, but throws the "ambiguity" exception for the MS SQL.

How to fix it with making no change to a "select...from" list of field names?

Thanks.


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>