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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:57:58+00:00 2026-05-23T12:57:58+00:00

Ok so its easier to give an example and hopefully some has a solution:

  • 0

Ok so its easier to give an example and hopefully some has a solution:

I have table that holds bids:

ID | companyID | userID | contractID | bidAmount | dateAdded

Below is an example set of rows that could be in the table:

ID | companyID | userID | contractID | bidAmount | dateAdded
--------------------------------------------------------------
10 | 2         | 1      | 94         | 1.50      | 1309933407
9  | 2         | 1      | 95         | 1.99      | 1309933397
8  | 2         | 1      | 96         | 1.99      | 1309933394
11 | 103       | 1210   | 96         | 1.98      | 1309947237
12 | 2         | 1      | 96         | 1.97      | 1309947252

Ok so what I would like to do is to be able to get all the info (like by using * in a normal select statement) the lowest bid for each unique contractID.

So I would need the following rows:

ID = 10 (for contractID = 94)
ID = 9 (for contractID - 95)
ID = 12 (for contractID = 96)

I want to ignore all the others. I thought about using DISTINCT, but i haven’t been able to get it to return all the columns, only the column I’m using for distinct.

Does anyone have any suggestions?

Thanks,
Jeff

  • 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-23T12:57:59+00:00Added an answer on May 23, 2026 at 12:57 pm
    select *
    from mytable main
    where bidAmount = (
        select min(bidAmount)
        from mytable
        where contractID = main.contractID)
    

    Note that this will return multiple rows if there is more than one record sharing the same minimum bid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is easier to explain with some code so I'll give an example first:
I have a bunch of forms where its easier to type the entire html
Interview question- Often its pretty easier to debug a program once you have trouble
I have a database and I want to allow users that I give permission,
Should I prepare my code for possible/predicted future changes so that it's easier to
its out of question that a dao will not hold any state. however, for
I have a data processing system that generates very large reports on the data
Not sure exactly how to explain this but Imaging you have a table with
We have an existing java-based heavyweight project that needed an interactive script interpreter. After
I'm writing an application that would allow users to edit a calendar, its description

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.