‎10-07-2014 10:27 PM
Solved! Go to Solution.
‎11-04-2014 06:26 PM
Select Distinct Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblSNMPInfo.IfIndex,
tblSNMPInfo.ifName,
tblSNMPInfo.IfDescription,
tblSNMPAssetMac.AssetMacAddress,
tblAssets1.AssetName As ConnectedAssetName,
tblAssets1.Domain As ConnectedAssetDomain,
tblAssets1.IPAddress As ConnectedAssetIP,
tblSNMPInfo.Uplink
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSNMPInfo On tblAssets.AssetID = tblSNMPInfo.AssetID
Left Join tblSNMPAssetMac On tblSNMPAssetMac.AssetID = tblSNMPInfo.AssetID And
tblSNMPAssetMac.IfIndex = tblSNMPInfo.IfIndex
Left Join tblAssetMacAddress On tblAssetMacAddress.Mac =
tblSNMPAssetMac.AssetMacAddress
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblAssetMacAddress.AssetID
Left Join (Select Distinct Top 1000000 tblSNMPAssetMac.AssetID,
tblSNMPAssetMac.IfIndex,
Count(tblSNMPAssetMac.SNMPMacID) As Count
From tblSNMPAssetMac
Group By tblSNMPAssetMac.AssetID,
tblSNMPAssetMac.IfIndex) SubQuery1 On SubQuery1.AssetID =
tblSNMPAssetMac.AssetID And SubQuery1.IfIndex = tblSNMPAssetMac.IfIndex
Where ((tsysAssetTypes.AssetTypename = 'switch') Or
(tsysAssetTypes.AssetTypename = 'router')) And (tblSNMPInfo.Uplink = 'true'
Or SubQuery1.Count > 1)
Order By tblAssets.AssetName,
tblSNMPInfo.IfIndex
‎11-04-2014 06:26 PM
Select Distinct Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblSNMPInfo.IfIndex,
tblSNMPInfo.ifName,
tblSNMPInfo.IfDescription,
tblSNMPAssetMac.AssetMacAddress,
tblAssets1.AssetName As ConnectedAssetName,
tblAssets1.Domain As ConnectedAssetDomain,
tblAssets1.IPAddress As ConnectedAssetIP,
tblSNMPInfo.Uplink
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSNMPInfo On tblAssets.AssetID = tblSNMPInfo.AssetID
Left Join tblSNMPAssetMac On tblSNMPAssetMac.AssetID = tblSNMPInfo.AssetID And
tblSNMPAssetMac.IfIndex = tblSNMPInfo.IfIndex
Left Join tblAssetMacAddress On tblAssetMacAddress.Mac =
tblSNMPAssetMac.AssetMacAddress
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblAssetMacAddress.AssetID
Left Join (Select Distinct Top 1000000 tblSNMPAssetMac.AssetID,
tblSNMPAssetMac.IfIndex,
Count(tblSNMPAssetMac.SNMPMacID) As Count
From tblSNMPAssetMac
Group By tblSNMPAssetMac.AssetID,
tblSNMPAssetMac.IfIndex) SubQuery1 On SubQuery1.AssetID =
tblSNMPAssetMac.AssetID And SubQuery1.IfIndex = tblSNMPAssetMac.IfIndex
Where ((tsysAssetTypes.AssetTypename = 'switch') Or
(tsysAssetTypes.AssetTypename = 'router')) And (tblSNMPInfo.Uplink = 'true'
Or SubQuery1.Count > 1)
Order By tblAssets.AssetName,
tblSNMPInfo.IfIndex
‎10-31-2014 06:04 PM
‎10-10-2014 11:45 AM
Select Distinct Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblSNMPInfo.IfIndex,
tblSNMPInfo.ifName,
tblSNMPInfo.IfDescription,
tblSNMPAssetMac.AssetMacAddress,
tblAssets1.AssetName As ConnectedAssetName,
tblAssets1.Domain As ConnectedAssetDomain,
tblAssets1.IPAddress As ConnectedAssetIP
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSNMPInfo On tblAssets.AssetID = tblSNMPInfo.AssetID
Left Join tblSNMPAssetMac On tblSNMPAssetMac.AssetID = tblSNMPInfo.AssetID And
tblSNMPAssetMac.IfIndex = tblSNMPInfo.IfIndex
Left Join tblAssetMacAddress On tblAssetMacAddress.Mac =
tblSNMPAssetMac.AssetMacAddress
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblAssetMacAddress.AssetID
Inner Join (Select Distinct Top 1000000 tblSNMPAssetMac.AssetID,
tblSNMPAssetMac.IfIndex,
Count(tblSNMPAssetMac.SNMPMacID) As Count
From tblSNMPAssetMac
Group By tblSNMPAssetMac.AssetID,
tblSNMPAssetMac.IfIndex
Having Count(tblSNMPAssetMac.SNMPMacID) > 1) SubQuery1 On SubQuery1.AssetID =
tblSNMPAssetMac.AssetID And SubQuery1.IfIndex = tblSNMPAssetMac.IfIndex
Where (tsysAssetTypes.AssetTypename = 'switch') Or
(tsysAssetTypes.AssetTypename = 'router')
Order By tblAssets.AssetName,
tblSNMPInfo.IfIndex
‎10-08-2014 07:40 PM
‎10-08-2014 05:58 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now