select c.card_number,c.card_name,t.type_name,c.card_discount,t.type_low,c.card_integral,(c.ca
select
c.card_number,
c.card_name,
t.type_name,
c.card_discount,
t.type_low,
c.card_integral,
(c.card_recharge_balance+c.card_give_balance) as num,
v.people,
c.card_time
from
`vip_card` as c
left join
(
select
count(vipid) as people,
card_number
from vip
group by card_number
) as v
on
c.card_number=v.card_number
left join
`vip_type` as t
on
c.type_id=t.type_id
where
c.store_key='556655';
--结束END--
本文标题: mysql语句写法(左连与子查询结合)实战
本文链接: https://lsjlt.com/news/36109.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0