1
我正在开发一个asp.net项目。我需要用两种不同的条件过滤数据库,并在饼图中显示每个条件。所以我需要在一个查询中获得两列。在一个查询中获取两个完全不同的列
1列:
select COUNT (*) 'OAS' from atmterminalfile (nolock) where Atstatu='2' and atlinestat ='1'
2列:
select COUNT (*) 'OFS' from atmterminalfile (nolock) where Atstatu='2' and atlinestat ='2'
我搜索了很多的解决方案,我想联盟,而且结果是这个
| OAS |
|----------------|
| Column 1 Count |
| Column 2 Count |
我只需要这一点。
| OAS | OFS |
---------------------------------------
| Column 1 Count | Column 2 Count |
工作,谢谢! –
如何通过添加以下内容来加速:(1,2)中的atlinestat(atlinestat) –