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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:26:25+00:00 2026-06-14T17:26:25+00:00

I have a dataset with an ID and value. For each value I want

  • 0

I have a dataset with an ID and value. For each value I want to get its corresponding frequency in the dataset. What is the most efficient pure SQL query-based solution? (that is not using java etc…) Or would it be more efficient to use Java with SQL?

  1. I am using Derby SQL

This is my previous solution for this problem

  1. Get all distinct values in a new table and add a frequency column
  2. Write Java code to iterate through all distinct values in this new table and run a counting query against the original dataset

I would really like to avoid the extra Java code…

All help is appreciated!

  • 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-14T17:26:27+00:00Added an answer on June 14, 2026 at 5:26 pm
    SELECT COUNT(DISTINCT value)
      FROM dataset
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a parameter @Department and set its value in the Dataset to =Join(Parameters!Department.Value,,)
Using SQL Server, have a name value pair table. Each row is basically userid,
I have a select form with different options. I want to get the value
I have two data sets, each dataset contains the pixel values of an image.
I have a dataset that i am trying to set the default value as
I have ten values in the dataset, numbers 1 - 10 and corresponding values.
I have a dataset with one datatable. Now I want to set a filter
I have a large dataset with documents that sometimes cross-reference each other, sometimes do
I have a very large dataset - millions of records - that I want
I have a dataset from a complex query which I've selected into a temp

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.