SELECT c.*,up.used FROM t_vip_coupon c,t_vip_user_coupon up WHERE up.uid=1 AND c.card_num=ANY(SELECT up.cou_cardNum FROM t_vip_user_coupon up WHERE up.uid=1) AND c.card_num = up.cou_cardNum
查询多表中的字段
最新推荐文章于 2023-07-09 15:41:07 发布
SELECT c.*,up.used FROM t_vip_coupon c,t_vip_user_coupon up WHERE up.uid=1 AND c.card_num=ANY(SELECT up.cou_cardNum FROM t_vip_user_coupon up WHERE up.uid=1) AND c.card_num = up.cou_cardNum