I have two tables Orders and Products where Orders has a ProductID as a forgin key,
I would like to select all products, if a product has orders i would like to select the one with the highest distance field.
thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Your question seems a bit unclear. However, I am assuming that your orders table has a ‘distance’ column. You would like to select all products with the order that has the highest distance value.
If you wanted the value of highest distance and not the entire order, then
Hope that helps.
Matrich