How to find unused tags trough SQL

How to retrieve all PI tags whose timestamp or value has not changed in the last 4 years via SQL?

 

Regards,

Igor