select sum1 ,sum2 ,sum3 from (select Company_Name,Tax_Type,sum(Tax_number) sum1 from table1)
你用的是什么数据库,这种语法SQL server是不行的。
你用的是什么数据库,这种语法SQL server是不行的。
解决方案 »
- [在线等!!!]如何通过域名获取网页的TITLE
- 从数据库读取出来的图片不正常
- ASP.NET的执行效率是不是明显高于ASP ??
- 在ASP.NET里如何创建甘特图
- 正在读ASP.net揭秘,关于分页的问题。请大家帮忙看一下
- Excel样式问题
- 关于cookie的问题。请指教。
- 为什么用REQUEST.USERHOSTNAME只能取得IP地址,而不是主机名?
- TreeView初始被选中某几个节点
- 问一下含汉子、数字、下划线的正则表达式
- 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(+);