select tt.int_interpreting_data_id,tt.dt_report_date,tn.str_norm_number,tnt.str_norm_type_name,tt.int_whether,tt.str_value,tt.str_detection_result,tt.str_remark,tn.str_name,tn.int_response_type,tt.str_device_name,tt.str_ip,tt.db_name,tn.str_code
from t_norm tn left join
(
select tid1.str_code,tid1.int_interpreting_data_id,tid1.dt_report_date,tid1.str_norm_type_name,tid1.int_whether,tid1.str_value,tid1.str_detection_result,tid1.str_remark,tid1.str_device_name,tid1.str_ip,tid1.db_name,tid1.str_norm_number from t_interpreting_data tid1,
(
select str_code,int_interpreting_data_id,str_norm_type_name,int_whether,str_value,str_detection_result,str_remark,str_device_name,str_ip,db_name,str_norm_number,max(dt_report_date) max_date from t_interpreting_data where 1=1
and str_property_id='windows 7_852'
and str_to_date(dt_report_date,'%y-%m-%d') ='2015-06-05'
group by str_norm_number,db_name
) tid2
where tid1.dt_report_date=tid2.max_date
group by tid1.str_norm_number,tid1.db_name
order by tid1.dt_report_date desc
) tt on tn.str_norm_number=tt.str_norm_number
left join t_norm_type tnt on tn.int_norm_type_id=tnt.int_norm_type_id
where tn.str_code in (select str_code from t_interpreting_data where str_property_id='windows 7_852' group by str_code)
order by tt.str_norm_number desc
1.以t_norm表为标准
2.查找 t_interpreting_data表中同一个类型最新的记录,同时根据db_name分组
SmartB2B 是一款基于PHP、MySQL、Smarty的B2B行业电子商务网站管理系统,系统提供了供求模型、企业模型、产品模型、人才招聘模型、资讯模型等模块,适用于想在行业里取得领先地位的企业快速假设B2B网站,可以运行于Linux与Windows等多重服务器环境,安装方便,使用灵活。 系统使用当前流行的PHP语言开发,以MySQL为数据库,采用B/S架构,MVC模式开发。融入了模型化、模板
0
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号