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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:43:12+00:00 2026-06-12T05:43:12+00:00

I am trying to convert my query result to and order them according to

  • 0

I am trying to convert my query result to and order them according to lowercase in asc order. But while displaying I need to preserve all the original case (lower and upper case).

My query looks like this –

SELECT distinct (p.product_id) as product_id ,lcase(p.product_name) as product_name 
from library TL, product p
WHERE TL.id = PL.id 
AND pL.product_id = p.product_id 
AND pL.product_id NOT IN (0)
order by lcase(product_name) asc;

But when I display it changes the entire dropdown values to lowercase. This is not what i want. I just want it to be displaying according to the order by lowercase.

How can I do it?

As far as I know, my orderby should have the same condition as the select isnt it?

How to make sort case insensitive while displaying the lower+upper case of values in the dropdown

  • 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-12T05:43:13+00:00Added an answer on June 12, 2026 at 5:43 am

    You can try this,

    SELECT product_id, product_name FROM (
        SELECT distinct (p.product_id) as product_id ,(p.product_name) as product_name,  
        lcase(p.product_name) as pname
        from unified.techlibrary TL, unified.techlibraryprod PL, unified.product p, unified.contenttype CT 
        WHERE TL.id = PL.id 
        AND pL.product_id = p.product_id 
        AND tl.contenttype_id in (1,3)  
        AND pL.product_id NOT IN (0)
    ) AS x order by x.pname
    

    Hope it will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to convert a SQL Query to a linq query in vb. But
I am trying to compare dates, but my query doesnot return any result. Curious
Hi I am trying to convert a a LINQ query result into a list
I'm trying to convert this SQL query to L2S.. SELECT TOP 5 vt.* FROM
I'm trying to convert this SQL query to LINQ: SELECT Items.p_Name Product, DiamondCategory.dc_Name Category,
I am trying to convert a mySQL query into a JSON object. This works:
Here's the query I'm trying to convert into Linq: SELECT R.Code, R.FlightNumber, S.[Date], S.Station,
I'm trying to convert a MS Access query into a SQL Sever stored procedure
I'm trying convert all special chars into HTML safe entities on their way into
I have an issue where I am trying to order a result set by

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.