1 select nc.Class_Name,hn.home_news_id,hn.hemo_id,hn.hemo_Date, 2 hn.hemo_title,hemo_order from Hemo_News as hn 3 inner join NewsClass as nc on hn.home_news_id = nc.home_news_id 4 where hn.home_news_id='2' order by 5 case when hemo_order = 0 then 0 el 6 se 1 end desc,hemo_order asc
1 // <summary> 2 /// 获得数据列表 3 /// </summary> 4 public DataSet GetList(string strWhere) 5 { 6 string strSql = "select nc.Class_Name,hn.home_news_id,hn.hemo_id,hn.hemo_Date,hn.hemo_title,hemo_order from Hemo_News as"; 7 strSql = strSql + " hn inner join NewsClass as nc on hn.home_news_id = nc.home_news_id"; 8 if(strWhere.Trim()!="") 9 { 10 strSql = strSql + " where " + strWhere +"order by case when hemo_order = 0 then 0 else 1 end desc,hemo_order asc"; 11 } 12 return DbHelperSQL.Query(strSql.ToString()); 13 } 14 15 收藏于 2011-09-07