[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Help in creating a query....

Asked by imarshad in Oracle Database, Microsoft Access Database, Oracle 9.x

I need to fetch data from two tables(Vehicles, VData) in my database using the following criterion.
Vehicles table has fields (UnitID, vNo, vName) UnitID is Primary key and is unique for each record.
VData table has fields (UnitID, TimeDate, value1, value2) There are multiple records with same UnitID in this table.

Now I want to select the following
Each Unique UnitID in VData that is also present in Vehicles table and also its last record(Latest TimeDate value) from VData.

Part I of this query is easy i.e "Each Unique UnitID in VData that is also present in Vehicles table"

This can be simply done by using the following query
Select Vehicles.UnitID, Vehicles.vNo, Vehicles.vName from Vehicles where Vehicles.UnitID IN ( Select Distinct UnitID from VData)

But I am stuck as how to fetch the latest record for each UnitID in VData table.


Backend database Oracle 9i
Frontend VB6 and ADO

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Sample Data and expected results......
Vehicles Table
UnitID     vNo       vName
 1001      a1         xyz
 1002      a2         xyz
 1003      a3         xyz 
 1004      a4         xyz  
 1005      a5         xyz
 
VData Table
 
UnitID        TimeDate              value1    value2
 1001     2009/04/22 10:23           (Irrelevant)
 1001     2009/04/22 10:20           (Irrelevant)
 1003     2009/04/22 11:23           (Irrelevant)
 1003     2009/04/22 12:29           (Irrelevant)
 1004     2009/04/22 11:50           (Irrelevant)
 1004     2009/04/22 10:14           (Irrelevant)
 1004     2009/04/22 06:59           (Irrelevant)
 1004     2009/04/20 02:23           (Irrelevant)
 1006     2009/04/22 12:403          (Irrelevant)
 
Expected results after running the query.....
 
1001      a1         xyz      2009/04/22 10:23   value1    value2
1003      a3         xyz      2009/04/22 12:29   value1    value2
1004      a4         xyz      2009/04/22 11:50   value1    value2
[+][-]04/22/09 11:41 PM, ID: 24212261Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/22/09 11:43 PM, ID: 24212272Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/23/09 12:27 AM, ID: 24212474Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/23/09 01:04 AM, ID: 24212700Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04/24/09 12:35 AM, ID: 24222566Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/24/09 07:19 AM, ID: 24225482Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04/27/09 12:53 AM, ID: 24239556Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 01:14 AM, ID: 24239662Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 01:15 AM, ID: 24239671Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 01:33 AM, ID: 24239757Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Oracle Database, Microsoft Access Database, Oracle 9.x
Sign Up Now!
Solution Provided By: nav_kum_v
Participating Experts: 4
Solution Grade: A
 
[+][-]04/27/09 01:44 AM, ID: 24239809Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04/27/09 01:45 AM, ID: 24239810Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 01:54 AM, ID: 24239848Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_EXPERT_20070906