本文介绍了怀疑SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


PLANTATION_TYPE AREA_ACRES 品种

Plant 5 Master
植物7糖
响尾蛇5大师
响尾蛇8私人

我有这种格式的表格.我需要一个SQL查询,该查询应该以以下格式给出结果:

品种 种植英亩 Ratoon_Acres Totat_Acres
硕士5 5 10


对于每个品种",我都应该获取Plant和Ratoon(Plantation_Types)的详细信息,然后将它们的总和作为Total_Acres.

能否请您告诉我该怎么做,
adv

Hi,
PLANTATION_TYPE AREA_ACRESVARIETY

Plant 5 Master
Plant 7 Sugar
Ratoon 5 Master
Ratoon 8 Private

I have table in this format.I need a sql query that should give me the result in the format as

VARIETY Plant_Acres Ratoon_Acres Totat_Acres
Master 5 5 10


for every ''variety'' i should get the details of Plant and Ratoon(Plantation_Types) then their sum as Total_Acres.

Could some please tell me how to do this,
Tnx in adv

推荐答案

select sum(Price),Category_Id from YourTable group by (Category_Id)



这篇关于怀疑SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 20:43