sql ²éѯ³öÀ´Ò»¸ö±íÔÚ²åÈëµ½ÁíÒ»¸ö±íÀï
ALTER FUNCTION [dbo].[fun_tongji]()
RETURNS @t1 table (
yue int ,
money int
)
AS
begin
Declare @i int
set @i=1
-- declare @t1 table (
-- yue int ,
-- money int
-- )
while (@i<=12)
begin
INSERT into @t1 (yue,money) select isnull(sum(money),0) as money,@i as yue from zhangbenjilu where datepart(month,usedatetime)=@i
set @i=@i+1
end
return ;
end
Ïà¹ØÎĵµ£º
sql»ñÈ¡×Öĸ:
CREATE FUNCTION dbo.F_Get_STR (@S VARCHAR(100))
RETURNS VARCHAR(100)
AS
BEGIN
WHILE PATINDEX('%[^a-z]%',@S)>0
BEGIN
&n ......
±ÊÕßÔøÔÚ¡¶³ÌÐòÔ±¡·2009Äê11ÆÚÉÏ̽ÌÖTransact-SQLµÄÔª±à³Ì£¬¼´Í¨¹ýĿ¼ÊÓͼ¡¢ÔªÊý¾Ýº¯ÊýµÈ·½Ê½·ÃÎÊÊý¾Ý¿âµÄÔªÊý¾ÝÐÅÏ¢£¬ÔÚÖ´Ðйý³ÌÖж¯Ì¬Éú³ÉSQL½Å±¾¡£µ±Ê±ÏÞÓÚƪ·ù£¬Ëù¸øµÄÀý×Ó½ÏÉÙ¡£ÕâÀï¸ø³ö¶¯Ì¬Éú³ÉSQL½Å±¾µÄÒ»¸öµäÐÍÓ¦Ó㬰ÑÊý¾Ý±íµÄÄÚÈÝת»»ÎªÏàÓ¦µÄINSERTÓï¾ä¡£
Õâ¸öÆô·¢À´×ÔÎÒ¹ÜÀíÔ¶³ÌÊý¾Ý¿âµÄ¾Àú¡£ÎÒ³£³£ÐèÒªÓñ¾ ......
AcessÓëSQLµÄÇø±ð
ÒÔÏÂ總結ÁË×Ô¼ºÔÚ項Ä¿ÖÐËùÓöµ½µÄÓÐ關Acess與SQL²î異µÄһЩµØ·½£º
1£¬¶ÔÓÚÈÕÆÚ×Ö¶Î×Ö¶Î
¡¡¡¡access±íʾΪ:#1981-28-12#
¡¡¡¡SQLSERVER2000±íʾΪ:''1981-02-12''
¡¡¡¡2,SQLÓï¾äÇø±ð£¬_select,_updateÔÚ¶Ôµ¥±í²Ù×÷ʱ¶¼²î²»¶à£¬
¡¡¡¡µ«¶à±í²Ù×÷ʱupdateÓï¾ ......
·ÀÖ¹·Ç·¨±íD99_Tmp,kill_kkµÄ³öÏÖÊÇ·ÀÖ¹ÎÒÃǵÄÍøÕ¾²»±»¹¥»÷,ͬʱҲÊÇSQL°²È«·À·¶Ò»µÀ±ØÒªµÄ·ÀÏß,Ëä˵ÀûÓÃÕâÖÖ·½Ê½¹¥»÷µÄÈ˶¼ÊǺڿÍÖеÄСÄñ,µ«ÊÇÎÒÃÇÒ²²»µÃ²»·À,ÒÔÃâÔì³É²»¿ÉÏëÏóµÄºó¹û,·Ï»°²»¶à˵ÁË,˵Ï·À·¶·½·¨:
xp_cmdshell¿ÉÒÔÈÃϵͳ¹ÜÀíÔ±ÒÔ²Ù×÷ϵͳÃüÁîÐнâÊÍÆ÷µÄ·½Ê½Ö´Ðиø¶¨µÄÃüÁî×Ö·û´®,²¢ÒÔÎı¾Ðз½Ê½·µ»ØÈκÎÊ ......
ÔÎÄת×Ô:http://tech.it168.com/a2009/0218/265/000000265868.shtml
Ë÷ÒýÊÇÒÔ±íÁÐΪ»ù´¡µÄÊý¾Ý¿â¶ÔÏó¡£Ë÷ÒýÖб£´æ×űíÖÐÅÅÐòµÄË÷ÒýÁУ¬²¢ÇҼͼÁËË÷ÒýÁÐÔÚÊý¾Ý¿â±íÖеÄÎïÀí´æ´¢Î»Öã¬ÊµÏÖÁ˱íÖÐÊý¾ÝµÄÂß¼ÅÅÐò¡£Í¨¹ýË÷Òý£¬¿ÉÒÔ¼Ó¿ìÊý¾ÝµÄ²éѯËٶȺͼõÉÙϵͳµÄÏìӦʱ¼ä;¿ÉÒÔʹ±íºÍ±íÖ®¼äµÄÁ¬½ÓËٶȼӿ졣
µ«ÊÇ£¬ ......