May 2010 Entries

For Sun Virtual Box:

 use the Right-Ctrl (read: the ctrl key on the right side of your keyboard).

 

For VM Player:

ctrl + alt

There's more than one reason why you may receive this error, but the most common reason is that your order by statement column list doesn't correlate with your intended column-to-retrieve list when you happen to be using DISTINCT. This is usually easy to spot.

A more obscure reason may be that you are using a function around one of the selected columns --but omitting to use the same function around the same selected column name in the order by statement.

Here's an example:

select distinct upper(columnA)
  from [evaluate].[testTable]
   order by
columnA 
asc

 

This statement will cause the "Order by items must appear in the select list if SELECT DISTINCT is specified."  error to appear not because distinct was used, but because the order by statement did not utilize the upper() function around colunnA.  To correct this error, do this:

select distinct upper(columnA)
  from [evaluate].[testTable]
   order by upper(columnA)
asc