Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¶à×Ö¶ÎÄ£ºý²éѯsql like %% ÓÅ»¯ÓëÇø±ð

¶à×Ö¶ÎÄ£ºý²éѯsql like %% ÓÅ»¯ÓëÇø±ð
http://anforen.5d6d.com/
SELECT *
  from [KLims].[dbo].[Task] 
where  ClientCompany like '%a%' or [Address] like '%a%'
SELECT *
  from [KLims].[dbo].[Task] 
where  ClientCompany + [Address] like '%a%'
µ«µ±ÆäÖÐÒ»×Ö¶ÎΪnullʱ£¬ÓõڶþÖÖ»áÕÒ²»µ½Êý¾Ý¡£
http://four-corner.appspot.com/
ÒòΪµ±Ä³Ò»×Ö¶ÎΪnullʱ£¬Æ´½ÓµÄ×Ö¶ÎÕûÌ嶼Ϊnull£¬ÒªÈõڶþÖÖ°ì·¨¿ÉÒÔʹÓ㬿ÉÒÔÕâÑùд£¬½«ÎªnullµÄ×ֶΣ¬Ì滻Ϊ'';
SELECT *
  from [KLims].[dbo].[Task] 
where  isnull(ClientCompany,'') + isnull([Address],'') like '%a%'
ÕâÑù¼È¿ÉÕý³£Ö´ÐУ¬ÓÖ¸ßЧ¡£


Ïà¹ØÎĵµ£º

sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð


sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð
left join(×óÁª½Ó) ·µ»Ø°üÀ¨×ó±íÖеÄËùÓмǼºÍÓÒ±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
right join(ÓÒÁª½Ó) ·µ»Ø°üÀ¨ÓÒ±íÖеÄËùÓмǼºÍ×ó±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
inner join(µÈÖµÁ¬½Ó) Ö»·µ»ØÁ½¸ö±íÖÐÁª½á×Ö¶ÎÏàµÈµÄÐÐ
¾ÙÀýÈçÏ£º
-------------------------------------------- ......

SQL ServerµÄ¶¨Ðò(Collation)

ʹÓÃSQL ServerµÄÅóÓÑ們應該¶¼ÖªµÀSQL ServerµÄ資ÁÏ庫ÓÐÒ»個設¶¨½Ð×ö¶¨Ðò(Collation)£¬½ñÌìÎÒ們¾Í來¿´¿´¶¨Ðò這東Î÷ÊÇʲ麼£¬Ê×ÏÈÎÒ們¿´Ò»ÏÂWikiÉÏ對¶¨ÐòµÄ說Ã÷£º
Collation is the assembly of written information into a sta ......

[SQL Server] ÈÕÖ¾¹ÜÀí(´ýÐø)

 --±¸·ÝÊÂÎñÈÕÖ¾ (×ÔÉÏÒ»´Î±¸·ÝÒÔÀ´£¬ÖÁµ±Ç°µÄÒÑÍê³ÉµÄÊÂÎñµÄÈÕÖ¾)
backup log MyDBName to disk='F:\dbbak\GamePoint\MyDBName_log_2010052709.bak';
 
--½Ø¶ÏÈÕÖ¾(½Ø¶Ïµôµ±Ç°µÄÒÑÍê³ÉµÄÊÂÎñµÄÈÕÖ¾), SQL Server 2005, 2008ûÓÐÕâ¸öÑ¡Ïî.
backup log MyDBName with no_Log;
 
--ÊÕËõÈÕÖ¾(ÖÁ1M,µ ......

Sql Sever¼Ç¼µÄÐÐÁÐת»»

ÒÑÖªÒ»¸ö±íµÄ½á¹¹Îª£º
ÐÕÃû ¿ÆÄ¿ ³É¼¨
ÕÅÈý ÓïÎÄ 20
ÕÅÈý Êýѧ 30
ÕÅÈý Ó¢Óï 50
ÀîËÄ ÓïÎÄ 70
ÀîËÄ Êýѧ 60
ÀîËÄ Ó¢Óï 90
ÔõÑùͨ¹ýselectÓï¾ä°ÑËû±ä³ÉÒÔϽṹ£º
ÐÕÃû ÓïÎÄ Êýѧ Ó¢Óï
ÕÅÈý 20 30 50
ÀîËÄ 70 60 90
´ð:
CREATE TABLE [dbo].[Stu] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Name] ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ