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

SQL³£Óú¯ÊýÖ®Èý REPLICATE () £¿


°´Ö¸¶¨´ÎÊýÖØ¸´×Ö·û±í´ïʽ¡£
Óï·¨
REPLICATE ( character_expression, integer_expression)
²ÎÊý
character_expression
×Ö·ûÊý¾ÝÐ͵Ä×ÖĸÊý×Ö±í´ïʽ£¬»òÕß¿ÉÒÔÒþʽת»»Îª nvarchar »ò ntext µÄÆäËûÊý¾ÝÀàÐ͵Ä×ÖĸÊý×Ö±í´ïʽ¡£
integer_expression
¿ÉÒÔÒþʽת»»Îª int µÄ±í´ïʽ¡£Èç¹û integer_expression Ϊ¸º£¬½«·µ»Ø¿Õ×Ö·û´®¡£
·µ»ØÖµ
nvarchar »ò ntext
1 £ºSelect Replicate('abc',2) ----------------abcabc
2 £ºSelect Replicate£¨'abc',-2) ----------------null
3 £ºSelect Replicate('abc',0)--------------- ÎÞ


Ïà¹ØÎĵµ£º

sqlÓï¾ä×ܽá¶þ

sql¾«ÃîÓ÷¨
ÎÄÕ·ÖÀà:Êý¾Ý¿â
˵Ã÷£º¸´ÖƱí(Ö»¸´Öƽṹ,Ô´±íÃû£ºa бíÃû£ºb)
select * into b from a where 1<>1
˵Ã÷£º¿½±´±í(¿½±´Êý¾Ý,Ô´±íÃû£ºa Ä¿±ê±íÃû£ºb)
insert into b(a, b, c) select d,e,f from b;
˵Ã÷£ºÏÔʾÎÄÕ¡¢Ìá½»È˺Í×îºó»Ø¸´Ê±¼ä
select a.title,a.username,b.adddate ......

Sql(ÊÂÎï+Óαê)ʹÓ÷½·¨

--µ±Á½¸ö»òÁ½ÒÔÉϵIJÙ×÷Ҫô¶¼Ö´ÐУ¬ÒªÃ´¶¼²»Ö´ÐÐʱҪÓÃÊÂÎñ¡£
1. Sqlд·¨(ÊÂÎï+Óαê)
--¿ªÊ¼ÊÂÎñ
BEGIN TRAN
--²»ÏÔʾ¼ÆÊýÐÅÏ¢
SET NOCOUNT ON
DECLARE @ProjNo varchar(50),@CusNo varchar(50)
--ÉùÃ÷Óαê
DECLARE CRMPSContact_cursor CURSOR FOR 
SEL ......

SQL ·À×¢Èëʽ¹¥»÷

1¡¢¼ì²éÊÇ·ñÓзǷ¨×Ö·û
public static boolean sql_inj(String str)
{
    String inj_str = "'|and|exec|insert|select|delete|update|
count|*|%|chr|mid|master|truncate|char|declare|;|or|-|+|,";
//ÕâÀïµÄ¶«Î÷»¹¿ÉÒÔ×Ô¼ºÌí¼Ó
String[] inj_stra=inj_str.split("\\|");
    for ......

SQLÎÞÏÞ·Ö¼¶½á¹¹

×î½ü£¬ÒòΪÏîÄ¿µÄÔ­Òò£¬ÐèÒªÉè¼ÆÒ»¸öÊý¾Ý¿â£¬¸ÃÊý¾Ý¿âµÄ¹¦ÄÜÖ÷ÒªÊÇÃèÊöÎļþϵͳµÄ½á¹¹ºÍÎļþÐÅÏ¢£¬ÔÚÍøÉÏÕÒÁ˺ܶàµÄ×ÊÁÏ£¬µ«ÊÇÐí¶àÉè¼ÆÒªÃ´Õë¶Ô²éѯÁ¿±È½Ï¶àµÄÀ´×ö£¬ÒªÃ´Õë¶ÔÐ޸ġ¢²åÈëÁ¿±È½Ï¶àµÄÀ´×ö£¬¶ø¶ÔÓÚÎļþϵͳ¶øÑÔ£¬ËüµÄ²éѯ¡¢²åÈë¡¢Ð޸ͼÊÇÏ൱Ƶ·±µÄ£¬Òò´Ë£¬Êý¾Ý¿âµÄÉè¼Æ¼«ÆäÖØÒª,ÏÖ½«×Ô¼ºµÄÒ»µãÏ뷨˵˵£¬Ï£Íû´ ......

ÔÚSQLÓï¾ä²éѯ½á¹ûÖмÓÈë×ÔÔö³¤ÁÐ

Óï¾ä£ºselect rank() over(Order By ±íµÄÖ÷¼ü Desc) As UID ,ÆäËûÁÐ from ±í
˵Ã÷£ºrankº¯Êý
×÷Óãº
·µ»ØÖ¸¶¨Ôª×éÔÚÖ¸¶¨¼¯ÖеÄÅÅÃû£¨ÅÅÃû´Ó 1 ¿ªÊ¼£©
Rank(Tuple_Expression, Set_Expression [ ,Numeric Expression ] )
²ÎÊý£º
Tuple_Expression
Ò»¸öÓÐЧµÄ¶àά±í´ïʽ (MDX) Ôª ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ