Ãû´ÎËã·¨(sql server)(ת×Ô£º°®Ð¾õÂÞ.ع»ª)
±íjh03ÓÐÏÂÁÐÊý¾Ý£º
name¡¡score
aa¡¡¡¡99
bb¡¡¡¡56
cc¡¡¡¡56
dd¡¡¡¡77
ee¡¡¡¡78
ff¡¡¡¡76
gg¡¡¡¡78
ff¡¡¡¡50
1. Ãû´ÎÉú³É·½Ê½1,ScoreÖØ¸´Ê±ºÏ²¢Ãû´Î
SELECT *¡¡,¡¡Place=(SELECT COUNT(DISTINCT Score) from jh03 WHERE Score >= a.Score)
from jh03 a
ORDER BY Place
½á¹û
Name Score Place
---------------- ----------------- -----------
aa 99.00 1
ee 78.00 2
gg 78.00 2
dd 77.00 3
ff 76.00 4
bb 56.00 5
cc 56.00 5
ff 50.00 6
2. Ãû´ÎÉú³É·½Ê½2 , ScoreÖØ¸´Ê±±£ÁôÃû´Î¿Õȱ
SELECT * , Place=(SELECT COUNT(Score) from jh03 WHERE Score > a.Score) + 1
from jh03 a
ORDER BY Place
½á¹û
Name Score Place
--------------- ----------------- -----------
aa 99.00 1
ee 78.00 2
gg 78.00 2
dd 77.00 4
ff 76.00 5
bb 56.00 6
cc 56.00 6
ff 50.00 8
Ïà¹ØÎĵµ£º
--´´½¨Á´½Ó·þÎñÆ÷
exec sp_addlinkedserver 'server_tmp','','SQLOLEDB','Ô¶³Ì·þÎñÆ÷Ãû»òipµØÖ·'
exec sp_addlinkedsrvlogin 'server_tmp','false',null,'Óû§Ãû','ÃÜÂë'
exec sp_serveroption 'server_lnk','rpc out','true' --Õâ¸öÔÊÐíµ÷ÓÃÁ´½Ó·þÎñÆ÷ÉϵĴ洢¹ý³Ì
go
--µ÷Óãº
exec server_tmp.Êý¾ ......
SQL×¢Èë¹¥»÷µÄΣº¦ÐԺܴó¡£ÔÚ½²½âÆä·ÀÖ¹°ì·¨Ö®Ç°£¬Êý¾Ý¿â¹ÜÀíÔ±ÓбØÒªÏÈÁ˽âÒ»ÏÂÆä¹¥»÷µÄÔÀí¡£ÕâÓÐÀûÓÚ¹ÜÀíÔ±²ÉÈ¡ÓÐÕë¶ÔÐԵķÀÖδëÊ©¡£
¡¡¡¡Ò»¡¢ SQL×¢Èë¹¥»÷µÄ¼òµ¥Ê¾Àý¡£
¡¡¡¡statement := "SELECT * from Users WHERE Value= " + a_variable + "
¡¡¡¡ÉÏÃæÕâÌõÓï¾äÊÇºÜÆÕͨµÄÒ»ÌõSQLÓï¾ä£¬ËûÖ÷ҪʵÏֵŦÄܾÍÊÇÈÃÓû§Ê ......
SQLÊý¾Ý¿â³£ÓÃÃüÁî-´´½¨,ɾ³ý±í-Ìí¼Ó,ÐÞ¸Ä,ɾ³ý×Ö¶Î
http://blog.csdn.net/cncco/archive/2009/08/08/4424555.aspx
'´´½¨±í
CREATE TABLE dbo£®CategoriesNew
(CategoryID intIDETITY (1£¬1) NOT NULL£¬
CategoryName nvarchar(15) NOT NULL£¬
Description ntext NULL£¬
Picture image NULL)
'ɾ³ý±í
DROP TABL ......
½â¾öSQL Injection©¶´µÄÒ»¸öº¯Êý
http://blog.csdn.net/cncco/archive/2006/04/07/654254.aspx
º¯Êý
<%
Function CheckInput(str,strType)
'º¯Êý¹¦ÄÜ£º¹ýÂË×Ö·û²ÎÊýÖеĵ¥ÒýºÅ£¬¶ÔÓÚÊý×Ö²ÎÊý½øÐÐÅжϣ¬Èç¹û²»ÊÇÊýÖµÀàÐÍ£¬Ôò¸³Öµ0
'²ÎÊýÒâÒ壺 str ......