select sum1 ,sum2 ,sum3 from (select Company_Name,Tax_Type,sum(Tax_number) sum1 from table1)
你用的是什么数据库,这种语法SQL server是不行的。
你用的是什么数据库,这种语法SQL server是不行的。
解决方案 »
- Repeater导出EXCEL
- 在线等,求救,急死人了,IE FF 打开网页有时候进度条不动,但状态栏却一直显示正在打开,但却显示不了页面
- 项目在调试环境下做好后还需做怎样的修改?
- DetailsView即时更新
- 如何让AJAX中刷新出错不弹出提示框
- 网站配置的问题,请教高手!
- aspnetpager 中文参数BUG?webdiyer前辈请进
- 有60010条记录,每页20条记录,大家做来翻页要多少时间
- 新手提问:在ASP.Net里面怎么用全局对象?
- 关于List<>泛型绑定的问题?
- ASP.NET 工作进程 (Aspnet_wp.exe) 被意外回收(求版主回答)
- 我在datagrid的标题行中放了一个按钮用来执行排序,怎么在程序中动态设置他的text属性?
select * from something where(子查询(子查询));把你上面的改成:
select sum1,sum2,sum3 from table2 where sum1 in (select company_name,tax_type,sum(tax_number) from table1)
大家认为一定是在字符串中出现问题的吗?
select cast(0 as bit) as Ifpubs,ResourceID,subid,Acronym,UseCount, AllCount,enddate from @table as tab
where not exists (select * from Metalallitem where AllWeekId=0 and tab.ResourceID=Metalallitem.ResourceID and tab.subid=Metalallitem.subid)
order by ResourceID,subid
上面这句话是我从调试窗口拉出来的,这句话在Oracle中运行是没有问题的。
我把他Copy到Oracle中执行结果没有错我想实现的功能是:
http://expert.csdn.net/Expert/topic/2661/2661232.xml?temp=.9875605http://expert.csdn.net/Expert/topic/2661/2661955.xml?temp=3.565615E-02
就是想把一张表格中查到的结果放到一个DataGrid中。
(select Company_Name,Tax_Type,sum(Tax_number) sum1 from table1 where substr(to_char(Tax_Time),1,6)=substr(to_char(sysdate,'YYYYMMDD'),1,6) and Company_Name like '%北京%' group by Company_Name,Tax_Type) tab_1, (select Company_Name,Tax_Type,sum(Tax_number) sum2 from table1 where substr(to_char(Tax_Time),1,4)=substr(to_char(sysdate,'YYYYMMDD'),1,4) and Company_Name like '%北京%' group by Company_Name,Tax_Type) tab_2, (select Company_Name,Tax_Type,sum(Tax_Number) sum3 from table1
where Company_Name like '%北京%' group by Company_Name,Tax_Type) tab_3 where tab_1.Company_Name = tab_2.Company_Name(+) and tab_1.Tax_Type = tab_2.Tax_Type(+) and tab_1.Company_Name = tab_3.Company_Name(+) and tab_1.Tax_Type = tab_3.Tax_Type(+);