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

  • Home
  • SEARCH
  • 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 302497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:06:10+00:00 2026-05-12T07:06:10+00:00

I want to retrieve the most recent requestid from table tblquoteproposal` for perticular customerId

  • 0

I want to retrieve the most recent requestid from table tblquoteproposal` for perticular customerId here 3, in this example ID 2 & ID 4.

table tblrequest
requestid Customerid
6 2
7 4
8 3
9 3

Table tblquoteproposal

 id requestid QuotePraposalLink comment
 1  6          jgj               mghm   
 2  7         jhgj               hjgj  
 3  8         xyz1              rifsf
*4  8         xyz2              ri2sf*
 5  9         xyz3              ri3sf
*6  9         xyz4              ri4sf*

In this table requestid is foreign key.
There is also another table tblrequest which has requestid as primary key.

I have written the following query but it doesn’t give me the right results:

SELECT r.RequestId,r.ConsultantId,(SELECT concat(FirstName,' ',LastName) 
                                   FROM tbluser 
                                   WHERE UserId = v_userId) as "Customer",
       r.RequestDate,r.QuoteDetailsFileLink,r.Requestcomment,r.CustomerId,
       qp.QuotePraposalLink,qp.Comment
FROM tblrequest r
LEFT OUTER JOIN tblquoteproposal qp ON r.RequestId=qp.RequestId 
WHERE r.customerid=v_userId 
GROUP BY r.RequestId 
ORDER BY qp.id ;
  • 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-12T07:06:10+00:00Added an answer on May 12, 2026 at 7:06 am

    Why not try:

    SELECT MAX(id)
    FROM tblquoteproposal
    GROUP BY requestid
    

    And feed the results of this query to whatever you need? (This can be a subquery).

    For example, your complete solution may be as follows (I’m using LEFT OUTER JOIN because you did so, I’m not sure it’s the right way, maybe INNER JOIN is more suitable):

    SELECT ... your fields ...
    FROM 
        tblquoteproposal p LEFT OUTER JOIN tblrequest r 
            on p.requestid = r.requestid
    WHERE p.id IN (
        SELECT MAX(id)
        FROM tblquoteproposal
        GROUP BY requestid )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML table as follows. I want retrieve row values from this
I want to retrieve the most recently added record from CoreData. I was wondering
I want to retrieve the most recently updated value in the table using an
I want to retrieve website title from webview cookies of my application. I am
I want to retrieve the local variables from Python from a called function. Is
I have an images table and a locations table I want to retrieve a
I want to retrieve information from an Excachange Server (2010 via EWS API). In
I want to retrieve the most recently added element and if there is none
I have two tables(Friends and News_Feed). I need to retrieve the most recent rows(highest
I'm having a hard figuring out how to programmatically retrieve the most recent photo

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.