常用sql语句用法

  1. union和Union All的区别 http://blog.csdn.net/wanghai__/article/details/4712555/

  2. case when 语句 select case when NR='增城' Then '增城市' when NR='从化' Then NR='从化' Then '从化市' Else NR END detail from xxxxx where bm='2'

  3. 查询符合条件的或者没有条件的:Select  count(*)  From XXXX t where (To_Char(Create_Time, 'yyyy-MM-dd') >= '2014-01-01' Or  '2014-01-01'Is Null) And (To_Char(Create_Time, 'yyyy-MM-dd') <='2014-04-30' Or '2014-04-30' Is Null)


你可能感兴趣的:(常用sql语句用法)