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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:12:12+00:00 2026-06-06T11:12:12+00:00

I have the follow query: SELECT pro.* FROM tb_AutProposta pro, tb_AutParcelamento par WHERE pro.id

  • 0

I have the follow query:

SELECT pro.* 
  FROM tb_AutProposta pro, tb_AutParcelamento par 
 WHERE pro.id = par.id

But, want to limit each tb_AutParcelamento to 1. Tried “Subselect”, but without success.

The table pro is an contract and par is the parcels of this contract. For each contract, is generated n parcels, and, for each parcel is generated a due date, and I need to know the last due date for each contract.

Any idea?

  • 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-06T11:12:14+00:00Added an answer on June 6, 2026 at 11:12 am

    I just made up some field names because we don’t know your exact table structure.

    This query works under the assumptions:

    • you want the latest (“highest”) parcel due date for each related contract
    • you have fields for due_date and pro_id in your parcel table. (tb_AutParcelamento.pro_id being a foreign key to the tb_AutProposta.id)
    • i made up pro_id because i assume the condition pro.id = par.id is wrong, when the id fields in both tables are auto increment values and the primary key in each table.
    SELECT pro.*, MAX(par.due_date) as latest_due_date
    FROM tb_AutProposta pro
    LEFT JOIN tb_AutParcelamento par
        ON pro.id = par.pro_id
    GROUP BY pro.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the follow query: SELECT `peers`.uid, `user`.userid FROM `peers`, `user` WHERE `user`.userid =
I have the follow SQL query statement: SELECT subject, sender_list, date, uid FROM messages
I have the follow query selecting stuff from a database: mysql_query(SELECT * FROM categories
Have follow query: SELECT tbl_yaca_sites.`id_site` FROM `tbl_yaca_sites` INNER JOIN `tbl_relation` ON tbl_relation.id_website = tbl_yaca_sites.id_site
I have the cursor with the query statement as follows: cursor.execute(select rowid from components
I have a mysql problem, my query looks as follows but not complete SELECT
I have a record that came from the follow linq query: using (var context
This is a follow on from another question i made I have this query
I have the follow Linq query ... which executes correctly: from t in Tasks
I have this MySql query : SELECT forum_categories.title, forum_messages.author, forum_messages.date AS last_message FROM forum_categories

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.