问题描述
我正在跟踪大约40种不同的缺陷。我希望所有的这些缺陷都按月和按年分别计算。我想
在报告中显示这些结果。我知道我可以创建40个查询(一个用于
每个缺陷)只有两个字段,计数和缺陷,并计算
字段,但这听起来很多工作。
有没有办法可以做得更简单快捷?
我的数据库有两个字段,一个叫做count。 (输入一个数字
来计算缺陷数量)。第二个字段称为缺陷
描述 (输入缺陷类型的地方)。
谢谢,
Don ..........
I have about 40 different defects I''m tracking. I''d like to have all of
these defects totaled individually, both by month and by year. I''d like to
show these results in a report. I know I could create 40 queries (one for
each defect) with just the two fields, count and defect, and sum the count
field but that sounds like a lot of work.
Is there a way I can do this much simpler and quicker?
My database has two fields, one is called "count" (where a number is entered
to count the number of defects). The second field is called "Defect
Description" (where the defect type is entered).
Thanks,
Don..........
推荐答案
----- BEGIN PGP签名消息-----
哈希:SHA1
你的意思是你的表有2列(又名字段)。数据库有表格;
表格有列。
这样的东西:
SELECT DefectDescription,SUM( DefectCount)AS缺陷
来自table_name
GROUP BY缺陷描述
-
MGFoster :: :mgf00< at> earthlink< decimal-point> net
奥克兰,加利福尼亚州(美国)
-----开始PGP SIGNATURE -----
版本: PGP个人隐私5.0
Charset:noconv
iQA / AwUBQzcbF4echKqOuFEgEQIeawCfcTJ5SqfDRWUjvcIpcBGxEo EjvDMAoNch
N4RrRKNg5lUcDomgY3aFr7AY
= L7Nm
-----结束PGP SIGNATURE -----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You mean your table has 2 columns (aka fields). A database has tables;
tables have columns.
Something like this:
SELECT DefectDescription, SUM(DefectCount) AS Defects
FROM table_name
GROUP BY DefectDescription
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQzcbF4echKqOuFEgEQIeawCfcTJ5SqfDRWUjvcIpcBGxEo EjvDMAoNch
N4RrRKNg5lUcDomgY3aFr7AY
=L7Nm
-----END PGP SIGNATURE-----
-----开始PGP签名消息-----
哈希:SHA1
你的意思是你的表有2列(又名字段)。数据库有表格;
表格有列。
这样的东西:
SELECT DefectDescription,SUM(DefectCount)AS缺陷
FROM table_name
GROUP BY缺陷描述
-
MGFoster ::: mgf00< at> earthlink< decimal-point> net
奥克兰,加利福尼亚州(美国)
-----开始PGP签名-----
版本:PGP个人隐私5.0
Charset:noconv
iQA / AwUBQzcbF4echKqOuFEgEQIeawCfcTJ5SqfDRWUjvcIpcBGxEo EjvDMAoNch
N4RrRKNg5lUcDomgY3aFr7AY
= L7Nm
-----结束PGP SIGNATURE -----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You mean your table has 2 columns (aka fields). A database has tables;
tables have columns.
Something like this:
SELECT DefectDescription, SUM(DefectCount) AS Defects
FROM table_name
GROUP BY DefectDescription
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQzcbF4echKqOuFEgEQIeawCfcTJ5SqfDRWUjvcIpcBGxEo EjvDMAoNch
N4RrRKNg5lUcDomgY3aFr7AY
=L7Nm
-----END PGP SIGNATURE-----
这篇关于总结查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!