--相信大家肯定經(jīng)常會把數(shù)據(jù)導(dǎo)入到數(shù)據(jù)庫中,但是可能會有些記錄行的所有列的數(shù)據(jù)是null,這為null的數(shù)據(jù)是我們不需要 --現(xiàn)在需要一個簡單的查詢來剔除掉這些為null的記錄行。 --假設(shè)表名為 emplyees --方法1. ---先把數(shù)據(jù)導(dǎo)入到數(shù)據(jù)庫 ---其次: select * from sys.columns where object_id =(select object_id from sys.objects where name='EMPLYEEs')
---方法2 ---使用數(shù)據(jù)庫提供的函數(shù) exec sp_columns 'Employees' delete from Employees where coalesce(status,tel,gwei,ADDRESS1,address2,nwei) is null