求大神给优化个sql


SELECT t.id                as id,
       t.tm_projectinfo_id as tmProjectinfoId,
       t.node_name         as nodeName,
       t.report_name       as reportName,
       t.report_path       as reportPath,
       t.node_date         as nodeDate,
       t.create_user       as createUser,
       t.create_datetime   as createDatetime,
       t.update_user       as updateUser,
       t.update_datetime   as updateDatetime,
       t.remark            as remark,
       t.delete_flag       as deleteFlagD
  FROM TT_KEYNOTE_REPORT t, tm_projectinfo pro
 where t.tm_projectinfo_id = pro.id
   and pro.project_cn = 'Fabia NF (SK260 CS)'
   and t.delete_flag = '0'
   and pro.delete_flag = '0'
   and t.create_datetime =
       (select max(kr.create_datetime)
          from tt_keynote_report kr, tm_projectinfo pro1
         where kr.tm_projectinfo_id = pro1.id
           and pro1.project_cn = 'Fabia NF (SK260 CS)'
           and kr.delete_flag = '0'
           and pro1.delete_flag = '0'
         group by kr.tm_projectinfo_id)
 order by t.node_name
;

你可能感兴趣的:(sql,数据库,优化)