Sql»ù±¾Óï¾äµÄѧϰ
--²éѯÿ¸öÈ˶©·¹µÄ´ÎÊý
select username as ÐÕÃû, count(*) as ´ÎÊý from orderitems group by UserName having count(*)=1
order by ÐÕÃû desc
select distinct username as δע²áÐÕÃû from orderitems
where username not in (select [Name] from Person)
select distinct username as ÒÑ×¢²áÐÕÃû from orderitems where username
in (select [Name] from Person)
--Ë÷ÒýΪ31-40µÄÊý¾Ý
select top 10 * from orderitems where ID not in (select top 30 ID from orderitems)
--¸´ÖÆÊý¾Ý
insert into distinctselect(UserName,State,OrderTime) select UserName,State,OrderTime from orderitems
--È¥³ýËùÓÐÖØ¸´µÄ¼Ç¼(ÍêÈ«ÖØ¸´)
select distinct UserName ,ID, State,OrderTime into #Table1 from [distinctselect]
delete from [distinctselect]
insert into [distinctselect](UserName,State,OrderTime) select UserName,State,OrderTime from #Table1
drop table #Table1
--ɾ³ýijÁÐÖØ¸´µÄ¼Ç¼
delete t
from [distinctselect] t
where exists (
select 1 from [distinctselect] where username=t.username and id<t.id)
select * from [distinctselect] order by username
delete from [distinctselect]
Ïà¹ØÎĵµ£º
ÎÒÏëÃæÊÔ¹ýÈí¼þ¿ª·¢µÄÅóÓѶ¼»áÅöµ½sql·½ÃæµÄÃæÊÔÌ⣬Õâ¸ö¿ÉÒÔ˵ÊÇÃæÊԱؿ¼µÄ¡£ÕâÀïÄü¸¸öÀý×Ó¿ªÍØÒ»ÏÂ˼·¡£
1.
ÓÐÕâÑùÒ»Õűí
½ÌʦºÅ
ÐÇÆÚ
ÊÇ·ñÓпÎ
1
1
ÓÐ
2
3
ÓÐ
1
2
ÓÐ
1
2
ÓÐ
ÒªµÃ³öÕâÑùµÄÊý¾Ý£º
ÐÕÃû
ÐÇÆÚÒ»
ÐÇÆÚ¶þ
ÐÇÆÚÈý
ÐÇÆÚËÄ
ÐÇÆÚÎå
1
1
......
½²½âSQL ServerÊý¾Ý¿â±»¹ÒÂíµÄ½â¾ö·½°¸
http://www.cnhacker.com/Security/Plan/200808/t20080822_6383.html
°¸Àý£ºÒ»¸öÍøÕ¾ÔâÓöÈëÇÖ£¬ÆÆ»µÏ൱ÑÏÖØ£¬SQLÊý¾Ý¿â±»¹ÒÂí£¬ËùÓеıíÀïÃæ´ó²¿·Ö×ֶζ¼±»¶à´ÎÖØ¸´²åÈë¹ÒÂí´úÂ룬²é¿´ÈÕÖ¾£¬»¹ºÃûÓÐÉæ¼°µ½·þÎñÆ÷µÄ°²È«£¬Ö»ÊÇÊý¾Ý¿âÄÇÀï³öÏÖÁ˺ܶàÒì³£¾¯¸æ¶øÒÑ£¬ÍøÕ¾È·Êµ´æÔÚ©¶´
......
Ò».×¢ÊÍ
-- µ¥ÐÐ×¢ÊÍ£¬´ÓÕâµ½±¾ÐнáÊøÎª×¢ÊÍsql Óï·¨£¬ÀàËÆC++£¬c#ÖÐ//
/* … */ ¶àÐÐ×¢ÊÍ£¬ÀàËÆC++£¬C#ÖÐ/* … */
¶þ.±äÁ¿£¨int£¬ smallint£¬ tinyint£¬ decimal£¬float£¬real£¬ money £¬smallmoneysql Óï·¨£¬ text £¬image£¬ char£¬ varchar¡£¡£¡£¡£¡£¡££©
Óï·¨£º
DECLARE
{
{@local_variable data_t ......
Ò»¡¢ SQLCLRȨÏÞ¼¯¼¶±ð
¡¡¡¡µ±ÄãʹÓÃCREATE ASSEMBLYÓï¾ä°ÑÒ»¸ö³ÌÐò¼¯¼ÓÔØµ½Ò»¸öÊý¾Ý¿âÖÐʱ£¬SQL ServerÌṩÁËÈýÖÖȨÏÞ¼¯¼¶±ð£ºSAFE£¬EXTERNAL_ACCESSºÍUNSAFE¡£ÕâЩȨÏÞ¼¯ÐγÉÈçͼ3ºÍͼ5£¨¾ùÇë²Î¿¼µÚ¶þƪ£©ËùʾµÄ AppDomain²ßÂÔ¼¶±ð¡£
¡¡¡¡ÏÂÃæÊÇÒ»¸öµäÐ͵ÄÓï¾ä£¬ËüʵÏÖ°²×°Î»ÓÚFileLoader.dllÎļþÄÚµ ......
ÕâÊÇ¡¶VC++¶¯Ì¬Á´½Ó¿â(DLL)±à³ÌÉîÈëdz³ö¡·µÄµÚËIJ¿·Ö£¬ÔĶÁ±¾ÎÄǰ£¬ÇëÏÈÔĶÁǰÈý²¿·Ö£º£¨Ò»£©
¡¢£¨¶þ£©
¡¢£¨Èý£©
¡£
¡¡¡¡MFCÀ©Õ¹DLLµÄÄںΪMFCµÄÀ©Õ¹£¬Óû§Ê¹ÓÃMFCÀ©Õ¹DLL¾ÍÏñʹÓÃMFC±¾ÉíµÄDLLÒ»Ñù¡£³ýÁË¿ÉÒÔÔÚMFCÀ©Õ¹DLLµÄÄÚ²¿Ê¹ÓÃMFCÒÔÍ⣬MFCÀ©Õ¹DLLÓëÓ¦ÓóÌÐòµÄ½Ó¿Ú²¿·ÖÒ²¿ÉÒÔÊÇMFC¡£ÎÒÃÇÒ»°ãʹÓÃMFCÀ©Õ¹DLLÀ´°üº¬ ......