sql根据某个字段求和并显示其他字段


 select sum(duration_time) as quantity,account,user_name,dept_name,parent_dept from blade_employee_training_record_detail
         where tenant_id=#{tenantId}
        <if test="startDate !=null and startDate !='' ">
            and end_training_date >= #{startDate}
        </if>
        <if test="endDate !=null and endDate !='' ">
            and end_training_date <= #{endDate}
        </if>
        GROUP BY account,user_name,dept_name,parent_dept

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM