关于asp.net操作oracle数据库的问题
select c.cod_mitem,b.rot_ord,b.Plan_wkhr_m,(sum(a.plan_wkhr_n) + sum(a.plan_wkhr_o))from web_wlms_o4sequence_user a
left join web_wlms_o3sequence b on a.rot_ord_id = b.id
left join web_wlms_o2order c on b.num_ord_id = c.id
group by c.cod_mitem,b.rot_ord,b.Plan_wkhr_m order by rot_ord
public static DataTable GetAll(){ string sql = "select c.cod_mitem,b.rot_ord,b.Plan_wkhr_m,sum(a.plan_wkhr_n) from web_wlms_o4sequence_user a"; sql = sql + string.Format("left join web_wlms_o3sequence b on a.rot_ord_id = b.id"); sql = sql + string.Format("left join web_wlms_o2order c on b.num_ord_id = c.id"); sql = sql + string.Format("where a.status ='01' group by c.cod_mitem,b.rot_ord,b.Plan_wkhr_m order by rot_ord"); //string sql = "select user_id,user_nm,adr_r from web_user"; DataTable dt = QueryHelper.QueryDataTable(sql); return dt;}
string sql = "select c.cod_mitem,b.rot_ord,b.Plan_wkhr_m,sum(a.plan_wkhr_n) from web_wlms_o4sequence_user a "; sql = sql + string.Format(" left join web_wlms_o3sequence b on a.rot_ord_id = b.id "); sql = sql + string.Format(" left join web_wlms_o2order c on b.num_ord_id = c.id ");