°´Ê±¼ä²éѯµÄSQLÓï¾ä
1¡¢°´Äê²éѯ£ºselect * from dbo.td_BBSBoardInfo where (year(BBI_DateTime) between 2006 and 2009)
°´Ô¡¢ÈÕ²éѯֻҪ½«year ¸ÄΪ month¡¢data
2¡¢°´ÄêÔ²éѯ£ºselect * from dbo.td_BBSBoardInfo where convert(varchar(6),BBI_DateTime,112) between 200606 and 200911
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
ºÍÊý¾Ý¿â´ò½»µÀҪƵ·±µØÓõ½SQLÓï¾ä£¬³ý·ÇÄãÊÇÈ«²¿Óÿؼþ°ó¶¨µÄ·½Ê½£¬µ«²ÉÓÿؼþ°ó¶¨µÄ·½Ê½´æÔÚ×ÅÁé»îÐԲЧÂʵ͡¢¹¦ÄÜÈõµÈµÈȱµã¡£Òò´Ë£¬´ó¶àÊýµÄ³ÌÐòÔ±¼«ÉÙ»ò½ÏÉÙÓÃÕâÖְ󶨵ķ½Ê½¡£¶ø²ÉÓ÷ǰ󶨷½Ê½Ê±Ðí¶à³ÌÐòÔ±´ó¶¼ºöÂÔÁ˶Ե¥ÒýºÅµÄÌØÊâ´¦Àí£¬Ò»µ©SQLÓï¾äµÄ²éѯÌõ¼þµÄ±äÁ¿Óе¥ÒýºÅ³öÏÖ£¬Êý¾Ý¿âÒýÇæ¾Í»á±¨´íÖ¸³öSQLÓ ......
ÔÚsql server2005ÖÐÔõô½øÐжàÖµÓë¶àÖµÖ®¼äµÄ±È½Ï£¿¿ÉÒԱȽÏÂð£¿
ÀýÈ磺
ÎÒÒªÖ¤Ã÷1£¬2£¬3£¬4£¬5£¨ÔÚ±íÖвéѯ³öµÄÖµ£©Óë3£¬2£¬6£¬5£¨×Ô¶¨Òå²ÎÊý£©Á½ÌõÊý¾ÝÖÐÓÐÏàͬµÄÖµ£¬²¢½«ÏàֵͬµÄÁеÄÏàÓ¦±íÐÅÏ¢ÓÃprint´òÓ¡³öÀ´
×¢Ò⣬²»Äܵ¥¸ö±È½Ï……
²»ÖªµÀ¿É²»¿É²éѯ³öÀ´£¬ Çë¸÷λ¸ßÊÖ°ï°ïæ……
......
×Ó±í²éѯ£¬¸¸±íÒ»¶¨Òª¼Ó±ðÃû£¬·ñÔòÊý¾Ý»áÓÐÎÊÌ⣬²»±¨±àÒë´í
select * from table1 a where exist(select 1 from table2 where a.id=b.id)
´æ´¢¹ý³Ì½á¹û¼¯²åÈëµ½ÏÖÓбí
insert into table1 exec procname args
ÁªºÏÒÑÓÐ±í£¬½ô¸úÔÚºóÃæ£¬¶Ô»ã×ܺÜÓÐÓÃ
select a from table1 union all select 'ºÏ¼Æ'
½á¹û¼¯ÀïµÄij ......
´ËÎÊÌâÕÛÌÚ°ëÌì,googleÒ²ËÑË÷ÁË,ÍøÉϺܶàÅóÓÑÒ»°ã×öµ½µÚ¶þ²½²»³É¹¦,ÎÒÒ²²îµã·ÅÆúÁË.×îºóͨ¹ýµÚÈý²½Á¬½Ó³É¹¦ÁË.
1.·À»ðǽÔÊÐí1433
2.ÅäÖù¤¾ßÀïµÄSQL Server ÅäÖùÜÀíÆ÷.´ò¿ªºó,¿ªÆôÓÒ±ßÈý¸öÐÒé.²¢¶Ôtcp/ipÈçÏÂÅäÖÃ
3.ÍøÉϴ󲿷Ö×öµ½µÚ¶þ°æÖØÆôsql server·þÎñ,ÈÔÈ»ÎÞЧ.Æäʵ,ÐèÒªÐÞ¸ÄÁ¬½Ó×Ö·û´®.Ö¸¶¨ÎÒÃÇÅäÖõĶ ......