如何把三段spl语句合并一起返回数据?
请问如何把这三段组合在一起返回:
select count(*) from (
select
a.amount as suixi_money,
a.amodanaTime as suixi_tiem,
a.registerMobile as principal_tel_number,
b.type as activity_type,
c.name as query_nickname,
c.mobile as query_tel_number,
c.realName as query_name
from tb_activity_record a
left join tb_activity b on a.activityId = b.id
left join tb_member c on a.memberId = c.id
where 1=1
and b.uid = '8445e6a4-9341-455b-bfef-81e0b5ed7a1e'
and (
c.name like '1%'
or c.realName like '1%'
or c.mobile like '1%'
)
) aa
select count(*) from (select distinct memberId from tb_activity_record ) ab
select SUM(amount) from tb_activity_record
谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个可以
使用union呀