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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:03:59+00:00 2026-05-13T11:03:59+00:00

If we start with the following simple SQL statement which works. SELECT sor.FPARTNO, sum(sor.FUNETPRICE)

  • 0

If we start with the following simple SQL statement which works.

SELECT sor.FPARTNO, sum(sor.FUNETPRICE)
FROM sorels sor
GROUP BY sor.FPARTNO

FPartNo is the part number and the Funetprice is obviously the net price. The user also wants the description and this causes a problem. If I follow up with this:

SELECT sor.FPARTNO, sor.fdesc, sum(sor.FUNETPRICE)
FROM sorels sor
GROUP BY sor.FPARTNO, sor.fdesc

If there are multiple variations of the description for that part number, typically very small variations in the text, then I don’t actually aggregate on the part number. Make sense?

I’m sure this must be simple. How can I return the first fdesc that corresponds to the part number? Any of the description variations would suffice as they are almost entirely identical.

Edit: The description is a text field.

  • 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-13T11:04:00+00:00Added an answer on May 13, 2026 at 11:04 am

    If you can’t upgrade to SQL Server 2005 for a (max) type 🙂

    Try this. SUBSTRING works on blobs, but returns varchar for text. So the aggregate should work and you lose some data

    SELECT
       sor.FPARTNO, MIN(SUBSTRING(sor.fdesc, 1, 8000)), sum(sor.FUNETPRICE)
    FROM
        sorels sor
    GROUP BY
        sor.FPARTNO, SUBSTRING(sor.fdesc, 1, 8000)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following SQL statement sample: SELECT DISTINCT [CommentNdx] ,[CommentsText] ,[DateTimeAdded] FROM [dbo].[CommentTable]
I have the following three simple T-SQL queries. First one is to get records
I am using the following SQL query in MySQL. SELECT SUBSTRING(invoices.dateCreated, 1, 7) AS
Hey guys I have the following sample. I have navigation which is loaded from
I could not start an OpenCV application under Windows. Given the following simple OpenCV
I'm newbie to Neo4j/GraphDB and have created following simple graph node[1]user1 which is 'friend'
I start with the following list s and bitmask b : s = ['baa',
I tried the following DateTime start = Convert.ToDateTime(TextBox1.Text); DateTime end = Convert.ToDateTime(TextBox2.Text); if (DateTime.Now.Date
I'm a starting C/C++ programmer. What I want is the following thing: Start program,
Getting the following error when trying to start a session: Warning: session_start() [function.session-start]: Node

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.