SQL示例 - 自上次扫描以来的Delta
此示例查询对上次扫描的结果进行比较,并提供可配置的阈值。
您可以随意调整阈值术语,使其符合您的要求。
SQL.
1与23.site_last_scan.作为(45选择site_id,67(选择scan_id.作为last_scan.89从dim_site_scan.10.11.加入dim_scan.使用(scan_id.)12.13.在哪里site_id=ds.site_id14.15.命令通过完成的去世16.17.限制1)作为last_scan.18.19.从dim_site ds20.21.),22.23.site_previous_scan.作为(24.25.选择site_id,26.27.(选择scan_id.作为last_scan.28.29.从dim_site_scan.30.31.加入dim_scan.使用(scan_id.)32.33.在哪里site_id=ds.site_id和scan_id.不是在(选择last_scan.从site_last_scan.在哪里site_id=ds.site_id)34.35.命令通过完成的去世36.37.限制1)作为以前的唱片38.39.从dim_site ds40.41.),42.43.last_asset_count.作为(选择sls..site_id,数(Fas..asset_id)作为last_asset_count.44.45.从site_last_scan.作为sls.46.47.左外加入fact_asset_scan.作为Fas.在sls..last_scan.=Fas..scan_id.48.49.团体通过sls..site_id),50.51.52.53.previous_asset_count.作为(选择SPS..site_id,数(Fas..asset_id)作为previous_asset_count.54.55.从site_previous_scan.作为SPS.56.57.左外加入fact_asset_scan.作为Fas.在SPS..以前的唱片=Fas..scan_id.58.59.团体通过SPS..site_id),60.61.62.63.last_vuln_count.作为(选择sls..site_id,数(fasv.vulnerability_id)作为last_vuln_count.64.65.从site_last_scan.作为sls.66.67.左外加入fact_asset_scan_vulnerability_finding作为fasv在sls..last_scan.=fasv.scan_id.68.69.团体通过sls..site_id),7071.72.73.previous_vuln_count.作为(选择SPS..site_id,数(fasv.vulnerability_id)作为previous_vuln_count.74.75.从site_previous_scan.作为SPS.76.77.左外加入fact_asset_scan_vulnerability_finding作为fasv在SPS..以前的唱片=fasv.scan_id.78.79.团体通过SPS..site_id),8081.82.83.asset_count_change.作为(选择Lac..site_id,(Lac..last_asset_count.-pac.previous_asset_count.)作为asset_count_change.,84.85.案件什么时候(Lac..last_asset_count.-pac.previous_asset_count.)>1000然后'Mega增加'86.87.什么时候(Lac..last_asset_count.-pac.previous_asset_count.)>100.然后轻微的增加的88.89.什么时候(Lac..last_asset_count.-pac.previous_asset_count.)>10.然后'微小的增加'90.91.什么时候(Lac..last_asset_count.-pac.previous_asset_count.)<-1000然后'Mega减少'92.93.什么时候(Lac..last_asset_count.-pac.previous_asset_count.)<-100.然后'轻微减少'94.95.什么时候(Lac..last_asset_count.-pac.previous_asset_count.)<-10.然后'微小的减少'96.97.其他的“忽略”98.99.结束作为Asset_status.100.101.从last_asset_count.作为Lac.102.103.加入previous_asset_count.作为pac在Lac..site_id=pac.site_id),104.105.106.107.vuln_count_change.作为(选择Lac..site_id,(Lac..last_vuln_count.-pac.previous_vuln_count.)作为vuln_count_change.,108.109.案件什么时候(Lac..last_vuln_count.-pac.previous_vuln_count.)>1000然后'Mega增加'110.111.什么时候(Lac..last_vuln_count.-pac.previous_vuln_count.)>100.然后轻微的增加的112.113.什么时候(Lac..last_vuln_count.-pac.previous_vuln_count.)>10.然后'微小的增加'114.115.什么时候(Lac..last_vuln_count.-pac.previous_vuln_count.)<-1000然后'Mega减少'116.117.什么时候(Lac..last_vuln_count.-pac.previous_vuln_count.)<-100.然后'轻微减少'118.119.什么时候(Lac..last_vuln_count.-pac.previous_vuln_count.)<-10.然后'微小的减少'120.121.其他的“忽略”122.123.结束作为vuln_status.124.125.从last_vuln_count.作为Lac.126.127.加入previous_vuln_count.作为pac在Lac..site_id=pac.site_id)128.129.130.131.选择ds.姓名,Lac..last_asset_count.,pac.previous_asset_count.,lvc.last_vuln_count.,PVC.previous_vuln_count.,acc.asset_count_change.,acc.Asset_status.,vcc..vuln_count_change.,vcc..vuln_status.132.133.从last_asset_count.作为Lac.134.135.加入previous_asset_count.作为pac在Lac..site_id=pac.site_id136.137.加入last_vuln_count.作为lvc在Lac..site_id=lvc.site_id138.139.加入previous_vuln_count.作为PVC在Lac..site_id=PVC.site_id140.141.加入asset_count_change.作为acc在Lac..site_id=acc.site_id142.143.加入vuln_count_change.作为vcc.在Lac..site_id=vcc..site_id144.145.加入dim_site.作为ds在Lac..site_id=ds.site_id
这个页面对你有帮助吗?