¡¡¡¡a b c d
980515 ¾«í”Æó˜IÓÐÏÞ¹«Ë¾ º†¼ÒºÀ NULL
980514 È«ÐÀľ˜IÓÐÏÞ¹«Ë¾ NULL 123
980514 Ѹƒ|¿Æ¼¼¹É·ÝÓÐÏÞ¹«Ë¾ º†·ê¿£ NULL
980515 Â}Ô½‡øëHÆó˜IÓÐÏÞ¹«Ë¾ NULL 111
±í½á¹¹ÈçÉÏËùʾ£¬Òª²éѯCÁÐΪ¿ÕµÄ¼Ç¼µÄ£Ó£Ñ£ÌÓï¾ä²»ÊÇselect * from table where c=null; »òÕß select * from table where c=¡¯¡¯; ¶øÓ¦µ±ÊÇ select * from table where c is null; Ïà·´µØÒª²éѯ²»Îª¿ÕµÄÔòÓ¦µ±ÊÇ select * from talbe where c<>¡¯¡¯; »òÕß select * from table where c is not null; ×¢Ò⣺²»ÊÇnot is nullŶ¡£
·ÖÏí£º½ÒÃØ²Ù×÷ÈÕÆÚµÄSQLÓï¾ä´óÈ«
1.ÏÔʾ±¾ÔµÚÒ»Ìì SELECTDATEADD(mm,DATEDIFF(mm,0,getdate()),0) selectconvert(datetime,convert(varchar(8),getdate(), 120)+¡¯01¡¯,120) 2.ÏÔʾ±¾ÔÂ×îºóÒ»Ìì selectdateadd(day,-1,convert(datetime,convert (varchar(8),dateadd(month,1,getdate()),120