SQL Query to show dis-inherited sub-sites

Here is a SQL query I came up with quickly to find all dis-inherited sites in a content database:

use <content_db>
select Title, FullUrl from allwebs
where ParentWebID <> FirstUniqueAncestorWebID AND id = FirstUniqueAncestorWebId AND DeleteTransactionId = 0x
order by FullUrl

For you coders, you can use "SPPermissionCollection.Inherited" Property
https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.sppermissioncollection.inherited(v=office.12).aspx