首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

sql 话语

2012-06-28 
sql 语句一条sql语句select count(*) from bureau_info f where f.bur_id in(select distinct bur_id from

sql 语句

一条sql语句  select count(*) from bureau_info f where f.bur_id in(select distinct bur_id from ( select a.bur_id ,a.nonce_state from bureau_state a left join (select bur_id , max(sta_begin_date)maxDate from bureau_state  group by bur_id )t on a.bur_id = t.bur_id where a.sta_begin_date = t.maxDate)where nonce_state = '预警') and f.bur_line='2' and bur_state != '6'sql语句  select c.bur_project_name, c.bur_editer, d.nonce_state from (      select a.bur_id, a.nonce_state       from bureau_state a       left join (select bur_id, max(sta_begin_date) maxDate             from bureau_state             group by bur_id) b on a.bur_id = b.bur_id             where a.sta_begin_date = b.maxDate and a.nonce_state in ('预警', '高危') )d  left join bureau_info c on c.bur_id = d.bur_id where c.bur_state != '6' and c.bur_project_name is not null

热点排行