blackbirdMIT
IS-IT--Management
I would like to display each oil (the oilID and oilName) and the property (propertyID and propertyName) with the highest propertyID associated with it. I want the results by the oilID. The highest propertyID or number means it's more associated with an oil compared to a property with a lower propertyID.
Tables:
OILS table
OilID - PK, int(4)
OilName - nvarchar(50)
PROPERTIES table
PropertyID - PK, int(4)
PropertyName - nvarchar(50)
OILPROPERTIES table
OilID - int(4)
PropertyID - FK, int(4)
How do I do the subquery?
Tables:
OILS table
OilID - PK, int(4)
OilName - nvarchar(50)
PROPERTIES table
PropertyID - PK, int(4)
PropertyName - nvarchar(50)
OILPROPERTIES table
OilID - int(4)
PropertyID - FK, int(4)
How do I do the subquery?