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

  • Home
  • SEARCH
  • 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 6319593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:49:56+00:00 2026-05-24T15:49:56+00:00

I want to query the Oracle 10g database and get result on the basis

  • 0

I want to query the Oracle 10g database and get result on the basis of residential address in ascending or descending order. So the problem is building addresses are at time in the form of 110C or 200D, so according to sql “order by” asc or desc, I get the result as 200D before 20.
for eg, if adresses are 10 110 112 200D 232 95 20 100A 1050 944

In ascending order it will result in:-

 10 100 100A 1050 110 112 20 200D 232 944 95

The problem is as the adresses have characters in it, i can’t consider them to be as integers or number, they have to considered as String.

  • 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-05-24T15:49:57+00:00Added an answer on May 24, 2026 at 3:49 pm

    Use regular expressions:

    Warning! Potential non-working code ahead. I do not have an Oracle instance to test it against at the moment.

    SELECT YourAddress
    FROM YourTable
    order by TO_NUMBER(REGEXP_SUBSTR(AddressColumn, '^[0-9]+'));
    

    REGEXP_SUBSTR will find the number’s substring which is supposed to start the address, convert it to a real number and order by it.

    Caveat: you will have to improve the query to handle cases where a number will not be present. However, this answer can get you very well started.

    When in need to fine-tune the query, here are the resources you should use:

    • http://psoug.org/reference/regexp.html
    • http://psoug.org/snippet/Regular-Expressions–Regexp-Cheat-Sheet_856.htm
    • http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/functions116.htm

    And, yes, REGEXP_SUBSTR is available in Oracle 10g.

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

Sidebar

Related Questions

I have the following query that runs in my Oracle database and I want
In Matlab I'm using oracles data provider to query an oracle database. I want
i want query a file xml with linq, i want get all descendat of
We want the query result should be assigned with two results based on some
We have an Oracle 10g database (a huge one) in our company, and I
I am working with an Oracle 10g Database. I have the following two tables:
I'm using Oracle 10g. Question: How can I write query to return just ID
We are using Oracle 10g database, NHibernate, WCF and Silverlight 3.0 in our project
I am working on a query for a report in Oracle 10g. I need
I've got an Oracle 10g database, and I have a third-party jar file. I

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.