ÇóÒ»¸öSQLÓï¾ä - ÆäËûÊý¾Ý¿â¿ª·¢ / MySQL/Postgresql
voicefiles±í
args
type=callee&number=8001
type=callee&number=8002
type=callee&number=8003
type=callee&number=8004
type=callee&number=8005
voicefiles ÖÐµÄ args×ֶΠµÄÖµ±ÈÈçΪ type=callee&number=8005£¨&·Ö¸î£¬ÔÙ=·Ö¸îµÄÒâ˼£¿£©
ÈçºÎÈ¡ºóÃæÄǸö number =ºóÃæµÄÖµ£¨8005,ºóÃæµÄ×Ö·û³¤¶È²»¹Ì¶¨ &»òÕß=¹Ì¶¨£©È»ºóÓëcdr±íµÄ dst×ֶιØÁª£¿£¿£¿£¿
cdr ±íÖеÄ×Ö¶Î
dst×Ö¶Î
8001
8002
8003
8004
8005
ÇëÎÊÈçºÎʵÏÖmysql ²»ÊìϤ
ҪɶÑùµÄ½á¹ûÄØ£¿SQL code:
select * from voicefiles a,cdr b where b.dst=
right(a.args,locate('=',reverse(a.args))-1);
ÒÔÉÏ´¿Êô²Â²â
voicefiles±í
args×Ö¶Î
Öµ£ºtype=callee&number=8001£¨´ó¸Å¸ñʽÓóÌÐòµÄ»°Ëµ£¬ÊÇÏÈ&·Ö¸î,ÔÙ=ºÅ·Ö¸î£©
select args... from voicefiles;
ÒªµÄ½á¹û
args
8001¼´¿É
SQL code:
select right(args,locate('=',reverse(args))-1) args from voicefiles;
ËÉè¼ÆµÄ±í½á¹¹°¡£¿£¿£¡£¡
ÄãµÄµç»°¼Ç¼Èí¼þÕâô´æ¼Ç¼£¿
select SUBSTRING_INDEX(args,'=',-1) from voicefiles±í ¾ÍÐÐÁË¡£
ÈçºÎÈ¡ºóÃæÄǸö number =ºóÃæµÄÖµ£¨8005,ºóÃæµÄ×Ö·û³¤¶È²»¹Ì¶¨ &»òÕß=¹Ì
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
×Ö¶Î1,×Ö¶Î2.....×Ö¶ÎN,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
ÏëÒªµÄ½á¹ûÊÇ:
1,Na ......
ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬
·½·¨1£º
°Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû'
......
Ôõô°ÑMDFÊý¾Ýתµ½MySQL£¿
ÖÁÉٵø½¼Óµ½sqlserverÉÏ
¾ßÌåÔõôŪ°¡ ÎҵıÏÒµÉè¼ÆµÄÊý¾Ý¿âÊÇ´ÓÍøÉÏdownÏÂÀ´µÄ£¿£¿
Ä㻹²»ÈçÖ±½ÓÓÃsqlserverÄØ
º¯Êý¡¢´æ´¢¹ý³Ì¶¼µÃ¸ÄÁË¡£
sqlserverûÔõôÓùý¡£Ò²Ã»Óа²× ......
SQL code:
rs.open "select * from guide where city_name='±±¾©' order by pai desc",conn,1,1
do while not rs.eof or rs.bof
¡£¡£
¡£¡£
¡£¡£
rs.movenext
loop
Õâ¸ösqlÓï¾äÔÚwapÕ¾Àï ±¾ÉíÓÐ ......