Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 80671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:20:21+00:00 2026-05-10T21:20:21+00:00

I added the columns in the select list to the order by list, but

  • 0

I added the columns in the select list to the order by list, but it is still giving me the error:

ORDER BY items must appear in the select list if SELECT DISTINCT is specified.

Here is the stored proc:

CREATE PROCEDURE [dbo].[GetRadioServiceCodesINGroup]  @RadioServiceGroup nvarchar(1000) = NULL AS BEGIN SET NOCOUNT ON;  SELECT DISTINCT rsc.RadioServiceCodeId,                 rsc.RadioServiceCode + ' - ' + rsc.RadioService as RadioService FROM sbi_l_radioservicecodes rsc INNER JOIN sbi_l_radioservicecodegroups rscg  ON rsc.radioservicecodeid = rscg.radioservicecodeid WHERE rscg.radioservicegroupid IN  (select val from dbo.fnParseArray(@RadioServiceGroup,',')) OR @RadioServiceGroup IS NULL   ORDER BY rsc.RadioServiceCode,rsc.RadioServiceCodeId,rsc.RadioService  END 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:20:22+00:00Added an answer on May 10, 2026 at 9:20 pm

    Try this:

    ORDER BY 1, 2 

    OR

    ORDER BY rsc.RadioServiceCodeId, rsc.RadioServiceCode + ' - ' + rsc.RadioService 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added some columns to a table using rails and rake, but they do
i had added the following Opencart module for my order report list... http://www.opencart.com/index.php?route=extension/extension/info&extension_id=3597&filter_search=order%20list%20filter%20model&page=4 I
So I added a list view, and I am displaying 3 columns of strings
I need to query a list in SharePoint where the columns may be added
This link states that all columns that are nullable should be added to the
There is a constant change (!) in our database, new columns are often added.
I have already a query with multiple JOINs, simple list of reservations SELECT reservation.reservation_id,
Here is the fiddle http://jsfiddle.net/srinivasanvee/yYEwJ/2/ I have a list which has category, product, quantity
I have created a grid function using list control. There are two columns in
I've added a new column to a database and want to populate it from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.