---
title: "sql 统计"
author: "luoyexian"
date: "2010-11-08T15:33:07Z"
tags: ["SQL"]
categories: ["数据库"]
slug: "sql"
draft: false
lastmod: "2010-11-08T15:33:40Z"
id: 805679
url: "https://luoyexian.iteye.com/blog/805679"
---

select count(id) ,sum(cast(TK3\_13 as decimal(10,2)))/10000 as zmj,  
avg(cast(cast(zfj as float)/TK3\_13 as decimal(10,2))) as aaa from table  
where substring(date,0,8)='2010-10'