;

Sql操作收集

1.判断是否为空
    a>SELECT name=(case when name is null then 'not exists' else name  end) FROM sysobjects WHERE xtype ='PK'
    b>select iSNULL(max(type_id),0)+1 from c_type where type_class='类型'
        isnull有两个参数,第一个是需要判断的参数,
        第二个是如果第一个参数为null时,用于替换的值

Technorati 标签: sql
posted @ 2010-03-30 13:55  唐玉  阅读(172)  评论(0编辑  收藏  举报