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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:34:34+00:00 2026-06-11T02:34:34+00:00

I have three fields for width, height and depth. Let’s say I have these

  • 0

I have three fields for width, height and depth. Let’s say I have these values

width = 5
height = 0.1
depth = 3

I would like to filter out greatest two values from these values and do maths for two dimensions to find out the largest side.

It should be a * b

a = GREATEST(width, height, depth) /* greatest value selected */
b = GREATEST(width, height, depth) /* <-- select the second greatest value here */

The reason why I can’t ignore width here is that I don’t know which one of the width, height, depth has the max value and selected as the value of a

EDIT: Didn’t mention that these fields may contain NULL values

EDIT: The table contains dimensions for 2D objects to. In some cases depth may not exist. It can be NULL

  • 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-11T02:34:35+00:00Added an answer on June 11, 2026 at 2:34 am

    If the types are float, you may get rounding errors with this:

    a = GREATEST(width, height, depth)   /* greatest value selected */
    c = LEAST(width, height, depth)
    b = width + height + depth - a - c   /* middle value */
    

    Another route:

    b = ( SELECT width AS side
          FROM tableX
          WHERE pk = externalTable.pk
        UNION ALL
          SELECT height
          FROM tableX
          WHERE pk = externalTable.pk
        UNION ALL
          SELECT depth
          FROM tableX
          WHERE pk = externalTable.pk
        ORDER BY side DESC
          LIMIT 1 OFFSET 1
        ) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this, with three fields: User | Question# | Answer
I have a table ( HallPlan ) with fields: Row, Seat, Width, Height, X,
I have a table with three fields, FirstName, LastName and Email. Here's some dummy
I have a table with three fields, User , City and Country , where
I have three fields that must be unique in a table, and based on
I have a jqGrid in my project and I would like to add custom
In one of my views, I have three EditText fields. The first two are
I have a website design that includes text input fields that look like this:
I have Access table with fields, in which there is some data and path
I have one label field and three buttons with the name of red, yellow,

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.