这是我的SQL语句:
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%'
)
select count(*) from (select distinct memberId from tb_activity_record ) ac
select SUM(amount) from tb_activity_record
万分感谢