lin3360827 于 2016.02.18 14:18 提问

`````` select COUNT(distinct(c_cardno)) as 金卡总数  FROM   card_srv.enjoy_card.dbo.tb_o_card_interests a1(nolock)
where c_cardno like '61%'

select c_interest_amount as 金卡总利息  FROM   card_srv.enjoy_card.dbo.tb_o_card_interest a2(nolock)

select count(c_cardno) as 发行总数  FROM   card_srv.enjoy_card.dbo.tb_card a3(nolock)
where c_cardno like '61%' and c_status='正常'
``````

10800

31881.06

14611

123 123 123

4个回答

wen_wxpk   2016.02.18 14:25

select COUNT(distinct(c_cardno)) as 金卡总数, c_interest_amount as 金卡总利息, count(c_cardno) as 发行总数
from card_srv.enjoy_card.dbo.tb_o_card_interests a1(nolock),card_srv.enjoy_card.dbo.tb_o_card_interest a2(nolock), card_srv.enjoy_card.dbo.tb_card a3(nolock)
where c_cardno like '61%'
and c_cardno like '61%' and c_status='正常'

hopefully123   2016.02.18 14:41

select
(select COUNT(distinct(c_cardno)) FROM card_srv.enjoy_card.dbo.tb_o_card_interests a1(nolock)
where c_cardno like '61%')
as 金卡总数
(select c_interest_amount FROM card_srv.enjoy_card.dbo.tb_o_card_interest a2(nolock))
as 金卡总利息
(select count(c_cardno) FROM card_srv.enjoy_card.dbo.tb_card a3(nolock)
where c_cardno like '61%' and c_status='正常')
as 发行总数
from dual;

hopefully123   2016.02.18 14:45

bdmh      2016.02.18 14:22