Coalsece 返回第一个不是null的值

Coalsece 返回第一个不是null的值

  

select top 5 [objname]

      ,[objjc]

      ,[objorder]

      ,[objid]

      ,[parentid]

      ,[grade]

      ,[type]

      ,[href]

      ,coalesce( [rel],0) rel

      FROM [Menu]



  select top 5 [objname]

      ,coalesce( [rel],'0') rel

      FROM [Menu]

     order by NEWID()



       select top 5 [objname]

      , rel

      FROM [Menu]

     order by NEWID()

 

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图