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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:36:04+00:00 2026-05-23T13:36:04+00:00

Oracle version : 10g I’m trying to use the MIN function to find the

  • 0

Oracle version : 10g

I’m trying to use the MIN function to find the minimum/lowest value of a dataset. The column I’m performing MIN on is a VARCHAR2 column. This column will either contain a numeric value, or a value of ‘–‘ which represents that the value is not applicable.

When performing the MIN() function on the column, the ‘–‘ is always returned.
I want to find a way to exclude the ‘–‘ from being calculated in the MIN statement. I can’t use the WHERE clause in the statement to filter out columns with a ‘–‘ because that would exclude valid data.

Note: This is a huge legacy query (500+ lines) so re-writing this massive query is not really an option.

  • 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-23T13:36:04+00:00Added an answer on May 23, 2026 at 1:36 pm

    MIN(CASE WHEN ColX = '--' THEN NULL ELSE ColX END)

    This is valid in SQL Server and I think will probably work on Oracle as well.

    As a side note, never ever store numeric data in string fields.

    It’s inefficient from a space perspective and you will get some weird results when doing inequality comparisons.

    If you have these rows in your table:

    010
    009
    1
    

    The MAX value will be 1 and the MIN value will be 009

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

Sidebar

Related Questions

I make use of: NetBeans IDE 6.7.1, GlassFish v2.1, Oracle 10g XE, JAVA 6
I'm trying to connect my application with an Oracle database using NHIBERNATE 3.1.0.4000 version
I'm trying to connect to an Oracle 10g database using the built in Microsoft
I've got a new database here and it's an upgraded version from Oracle 10g
The Oracle version of our database is 10g. The stored procedure selects all the
I am trying to connect dropdownlist to bound with oracle 10g when i run
My oracle version is 10.2. It's very strange when a scalar subquery has an
We have Oracle Server Oracle Version: 10.2.0.4.0 - 64bit. I like to connect to
I have successfully installed Oracle 11g R2 version. I don't have good knowledge about
I'm using Oracle SQL Developer to query an Oracle DB (not sure which version

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.