jsÕýÔò½âÎöSQL×Ö·û´® - Web ¿ª·¢ / JavaScript
ÕýÔò±í´ïʽ ½âÎöSQL Óï·¨×Ö·û´®
×Ö·û´®ÑùÀý
JScript code:
select * from mtab
select * from mtab where id=10
select * (select * from mmtab where id=10) where id=10
//È¡µÃ (select * from mmtab where id=10)
select * (select * from mmtab where (id=10 and zz=5)) where id=10
//È¡µÃ (select * from mmtab where (id=10 and zz=5))
select * (select * from mmtab where (id=10 and zz=5)) where (id=10 zz=5)
//È¡µÃ (select * from mmtab where (id=10 and zz=5))
select * (select * from mmtab where (id=10 and zz=5)) where (id=10 zz=5) order by id desc
//È¡µÃ (select * from mmtab where (id=10 and zz=5))
ËùÓкó±ßÒ²¿ÉÄÜûÓÐwhere×Ó¾ä
ÏÈлл´ó¼ÒÁË
(?<=select \* )\([^)]+\)
ÉÏÃæÃ»ÓÐ˵Çå ÎÒµÄÒâ˼ÊÇ ÏëÒªµÚÒ»¸öÀ¨ºÅ Àï±ßµÄ¶«Î÷
Èç
JScript code:
select * (select * from mmtab where (id=10 and zz=5)) where (id=10 zz=5) order by id desc
//È¡µÃ (select * from mmtab where (id=10 and zz=5))
Ҫд¸öSQL Parser
¿ÉÒÔ¿´Ò»Ï TrimQuery http://code.google.com/p/trimpath/wiki/TrimQuery
(?<=select \* )\([^)]+[)][)]*
JScript code
Code highlighting produced by Actipro CodeHighlight
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001'
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......
ÎÒÏë²éѯ³öÿÌìÊý¾ÝµÄ×î´óµÄÒ»¸öÖµ¡£±íµÄ¸ñʽÈçÏÂ
±íÃû: hisdata
×Ö¶Î ±àºÅ Öµ ״̬ ʱ¼ä
Id value state dattime
101 32.3 0 ......
ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......