Uid name
There is another consumption table B
The bid uid bfee
How will the user table in table B have consumption records retrieved to all users
thank you
CodePudding user response:
Select * from a where the exists (select 1 from b where a.u id=b.u id)CodePudding user response:
Consumer of user informationSelect a. * from a a inner join (select uid from group B by uid) B on a.u id=b.u id
User + consumption
Select a. *, b.s umFee from a inner join (select sum (bfee) as sumFee, uid from group B by uid) B on a.u id=b.u id