IIabm/SQL_export_high_risk_settin...

20 lines
898 B
MySQL
Raw Normal View History

2023-06-11 22:42:04 +08:00
select count(*) from iiabmdb.without_exp_sample;
2023-05-21 17:05:06 +08:00
select distinct s_id from iiabmdb.without_exp_result where ts > 0;
select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id order by max_ts;
select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a
inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b
on a.id = b.s_id
group by e_id
order by count desc;
select e_id, count, max_max_ts, dct_lst_init_remove_firm_prod from iiabmdb.without_exp_experiment as a
inner join
(select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a
inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b
on a.id = b.s_id
group by e_id) as b
on a.id = b.e_id
2023-06-11 22:42:04 +08:00
where count >= 12
order by count desc;