陈斌彬的技术博客

Stay foolish,stay hungry

Sql语句判断字段不为空

USE [Asset]
GO

SELECT [ID]
      ,[CreateDate]
      ,[IsAvailable]
      ,[SiteCode]
      ,[SiteName]
      ,[SiteAlias]
      ,[SiteY]
      ,[SiteX]
      ,[BaseStation]
      ,[Location]
      ,[Remark]
  FROM [dbo].[SiteXX] where [SiteY] <>'' and    [SiteX] <>'' 
GO

select * from SiteXX where 1=1  and SiteX <> '' and SiteY <> '' and SiteX is Not NULL and SiteY is Not NULL