Reputation: 1
Depreciation table
Attached image is my depreciation table. From this ,I want an SQL Query which returns all asset tags with maximum depr_date
. that means asset tag with last depreciation date.
I want something like this
asset_tag depr_date
----------------------
TB29 2015-04-11
TB30 2015-03-11
PC626 2015-04-10
Upvotes: 0
Views: 174
Reputation: 188
Try below one.
SELECT asset_tag, max(depr_date)
FROM table
GROUP BY asset_tag
Upvotes: 2