I'm trying to write a query that returns the following:
1. Field #1 from TableA
2. Field #2 from TableB (only when it's SoftwareID matches the ID in TableA, there are multiple records in TableB that match TableA)
3. Return ONLY the record which has the highest value of Field #3 in TableB
This is what i tried, but it doesnt work like I want it to:
----------------
SELECT s.SoftwareName, s.Status, MAX(p.PackageRev), p.status
From swProducts s, swPackages p
Where s.softwareID = p.softwareID
----------------
PLEASE! this is driving me crazy
1. Field #1 from TableA
2. Field #2 from TableB (only when it's SoftwareID matches the ID in TableA, there are multiple records in TableB that match TableA)
3. Return ONLY the record which has the highest value of Field #3 in TableB
This is what i tried, but it doesnt work like I want it to:
----------------
SELECT s.SoftwareName, s.Status, MAX(p.PackageRev), p.status
From swProducts s, swPackages p
Where s.softwareID = p.softwareID
----------------
PLEASE! this is driving me crazy