文章标题
2017-11-29 23:17
211 查看
Mysql 关联表
SELECT C.*,C.bc_data[‘gender’] FROM
(select
id ,
max(d) as d
from table_a
where d >= ‘2017-11-22’ and bc_data[‘predict_true’<=0.2
group by a.id) A
INNER JOIN
(select f.user.id from b
where b.course_type=1 and b.student_amt=0
group by b.id) B
INNER JOIN
c C
on C.id=A.id and A.d=C.id;
SELECT C.*,C.bc_data[‘gender’] FROM
(select
id ,
max(d) as d
from table_a
where d >= ‘2017-11-22’ and bc_data[‘predict_true’<=0.2
group by a.id) A
INNER JOIN
(select f.user.id from b
where b.course_type=1 and b.student_amt=0
group by b.id) B
INNER JOIN
c C
on C.id=A.id and A.d=C.id;