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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:02:18+00:00 2026-06-03T22:02:18+00:00

I am trying to create a score based on the char_length of a field.

  • 0

I am trying to create a score based on the char_length of a field. I am using a fraction of the char_length returned.

 (CASE WHEN (char_length(e.summary)/100) is null THEN +0
  ELSE +(char_length(e.summary)/100) END)

I would like to know how to set a maximum return value. Is there a simple function or do I need to do one more CASE WHEN with if >=10 THEN … ?

  • 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-03T22:02:21+00:00Added an answer on June 3, 2026 at 10:02 pm

    Simplify to:

    LEAST(COALESCE(length(e.summary)/100, 0), 10)
    
    • Use LEAST() to introduce an upper border as @Mark already mentioned.
    • Use COALESCE() to provide a default for NULL values.
    • length() does the same as char_length()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a game save system which involves saving a score for
I'm trying to create a simple example to understand how to store then retrieve
Based on this question which was closed rather quickly: Trying to create a program
I'm trying to create ranges of IP addresses based off a file containing a
I am trying to become familiar with using the GWT api to create web
I am trying to dynamically build a form based on data returned from the
Using C++, I'm trying to create a generic container class to handle multiple data
I am trying to create a subscription based payment module for a project. There
I am trying to create a simple rating controller based on this answer. Rails
First, context: I'm trying to create a command-line-based tool (Linux) that requires login. Accounts

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.