zoukankan      html  css  js  c++  java
  • Case 降序升序排列

    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

  • 相关阅读:
    linux-log-files/
    SSL SSH
    C++学习的书籍
    Linux IO 分析
    LINUX 常用操作
    Find Large Files in Linux
    Linux 常见操作
    Linux Performance tool
    /linux-command-line-bash-shortcut-keys/
    Sed
  • 原文地址:https://www.cnblogs.com/dqh123/p/9470017.html
Copyright © 2011-2022 走看看