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 7846473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:35:30+00:00 2026-06-02T17:35:30+00:00

The below query is giving error: SELECT DISTINCT dealer_state FROM A WHERE country=’SS’ UNION

  • 0

The below query is giving error:

SELECT DISTINCT dealer_state
FROM A
WHERE country='SS' 
UNION
SELECT DISTINCT dealer_state
FROM B
WHERE country='SS'
ORDER BY upper(dealer_state)

How to sort using upper(column) in order by clause?

  • 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. Editorial Team
    Editorial Team
    2026-06-02T17:35:33+00:00Added an answer on June 2, 2026 at 5:35 pm

    Assuming that the “error” your query is giving is that it’s not ordering records from B amongst records from A as you had expected, you need to make your UNION query a subquery to one that performs the ordering:

    SELECT dealer_state FROM (
        SELECT dealer_state FROM A WHERE country='SS' 
      UNION
        SELECT dealer_state FROM B WHERE country='SS'
    ) t
    ORDER BY upper(dealer_state)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What does the below query explain? SELECT * FROM `jos_menu` WHERE (id = 69
I tried the below query but it didnt executed giving error as : >
Below is my query. Access does not like it, giving me the error Syntax
I have below SQL query: SELECT * FROM ( SELECT S.aCol, S.bCol, S.cCol, ROW_NUMBER()
I'm using Sql-Server, and I have the below query which returns all columns that
We have the query below. Using a LEFT OUTER join takes 9 seconds to
I'm using below mentioned query with about 400,000 records in each table its taking
Below is my HQL Query. delete from Table t where (t.column1=:value1 and t.column2=:value2) or
I'm having an issue with the below query: SELECT Consignments.LegacyID, Consignments.TripDate, Consignments.CollectionName, CASE WHEN
Below is the procedure which i have taken from net..but while executing its giving

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.