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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:29:41+00:00 2026-06-12T00:29:41+00:00

a table loadcount have two attributes did and count.i need to select did where

  • 0

a table loadcount have two attributes did and count.i need to select did where the count is lowest. for example if:

 did        count
 657        0
 698        1

then 657 has to be returned. similary if two rows have same count value and both are lowest then one of them needs to be selected at random.plzz help me.My academic project submission deadline is very near and i couldnt figure it on my own.Plzz provide me with codes,sql query.I am using microsoft access and java for the project.

  • 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-12T00:29:43+00:00Added an answer on June 12, 2026 at 12:29 am

    you can use the MIN function to find the lowest one

    SELECT MIN(expression)
    FROM tables
    WHERE predicates
    

    so in this case it would be

    SELECT MIN(count) as "Lowest Count"
    FROM tableName
    

    to select a random cell from the MIN info returned , it depends on what you are using MySQl, PostgreSQL, etc…

    Select a random row with MySQL:

    SELECT MIN(count) as "Lowest Count"
    FROM tableName
    ORDER BY RAND()
    LIMIT 1
    

    Select a random row with PostgreSQL:

    SELECT MIN(count) as "Lowest Count"
    FROM tableName
    ORDER BY RANDOM()
    LIMIT 1
    

    Select a random row with Microsoft SQL Server:

    SELECT TOP 1 MIN(count) as "Lowest Count"
    FROM tableName
    ORDER BY NEWID()
    

    Select a random row with IBM DB2

    SELECT MIN(count), RAND() as "Lowest Count"
    FROM tableName 
    ORDER BY IDX FETCH FIRST 1 ROWS ONLY
    

    Select a random record with Oracle:

    SELECT MIN(count)
    ( SELECT MIN(count)
    FROM tableName
    ORDER BY dbms_random.value )
    WHERE rownum = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Table A has two columns: ID and name I want to input 3 ID
Table A has a number of rows, only some of which have (multiple) children
Table 'leave_policies' has year, increment and total_entitled fields. I have written ' validates_uniqueness_of :year
Right now I have a table called Campaigns that has many Hits, if I
Table #1: qa_returns_items Table #2: qa_returns_residues I have a long time trying to get
So I have one NSArray that has names of documents to be presented in
Table Structure: I Tried this: select Id, Name from Color where ParentId=4 UNION select
Table: Relatives emp_id dep_id (composite primary key) We have to restrict one employee to
Table name: Employee Column Name: Emp_name Emp_name has this contents: xx\rama, xx\rajesh, xx\vignesh I
I have two tables: Holdings and Transactions Holdings data looks like: 06/30/2009, A, 100

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.