javaÀàÖÐдsqlÓï¾ä£¬²éѯÌõ¼þ°üº¬»»ÐÐ
detachedCriteria.add(Restrictions.or(
Restrictions.like("chengBanDanWeiIds", rForm.getChengBanDanWeiIds()+(char)13, MatchMode.START),
Restrictions.or(
Restrictions.like("chengBanDanWeiIds", rForm.getChengBanDanWeiIds()+ (char)13, MatchMode.END),
Restrictions.eq("chengBanDanWeiIds", rForm.getChengBanDanWeiIds())
)));
»»Ðв»ÓÃCHAR(13),ÓÃ(char)13
Ïà¹ØÎĵµ£º
SQL×¢Èëʽ¹¥»÷ÊÇÀûÓÃÊÇÖ¸ÀûÓÃÉè¼ÆÉϵÄ©¶´£¬ÔÚÄ¿±ê·þÎñÆ÷ÉÏÔËÐÐSqlÃüÁîÒÔ¼°½øÐÐÆäËû·½Ê½µÄ¹¥»÷¶¯Ì¬Éú³ÉSqlÃüÁîʱûÓжÔÓû§ÊäÈëµÄÊý¾Ý½øÐÐÑéÖ¤ÊÇSql×¢Èë¹¥»÷µÃ³ÑµÄÖ÷ÒªÔÒò¡£
±ÈÈ磺
Èç¹ûÄãµÄ²éѯÓï¾äÊÇselect * from admin where username="&user&" and password="&pwd&""
ÄÇô£¬Èç¹ûÎÒµÄÓû§ÃûÊ ......
MySQLÖÐÎIJο¼ÊÖ²á- 7 MySQL ÓïÑԲο¼
<!--
body { font-size: 9pt; }
a:hover{color:red;}
a.t1:visited{color:red;}
-->
DATABASE()
·µ»Øµ±Ç°µÄÊý¾Ý¿âÃû×Ö¡£
mysql> select DATABASE();
-> 'test'
Èç¹ûûÓе±Ç°µÄÊý¾Ý¿â£¬DATABASE()
·µ»Ø¿Õ×Ö·û´®¡£
USER()
¡¡
SYSTEM_USER()
......
±íÖÐÖ÷¼ü±ØÐëΪ±êʶÁУ¬[ID] int IDENTITY (1,1)
1.·ÖÒ³·½°¸Ò»£º(ÀûÓÃNot InºÍSELECT TOP·ÖÒ³)
Óï¾äÐÎʽ£º
SELECT TOP Ò³¼Ç¼ÊýÁ¿ *
from ±íÃû
WHERE (ID NOT IN
(SELECT TOP (ÿҳÐÐÊý*(Ò³Êý-1)) ID
from ±íÃû
ORDER BY ID))
ORDER BY ID
//×Ô¼º»¹¿ÉÒÔ¼ÓÉÏһЩ²éѯÌõ¼þ
Àý:
sele ......
< type="text/javascript">
< type="text/javascript">
ÈçתÔØ£¬Çë×¢Ã÷³ö´¦£ºhttp://blog.csdn.net/robinson_0612/archive/2009/11/07/4783702.aspx
Ëæ×ŵ±½ñÊý¾Ý¿âµÄÈÝÁ¿Ô½À´Ô½¿ìµÄ³¯×ÅÔÚ´óÐÍÊý¾Ý¿â»ò³¬´óÐÍÊý¾Ý¿âµÄ·¢Õ¹£¬¶ÔÓÚÊý¾Ý¿âÖеĴóÐͱíÒÔ¼°¾ßÓи÷ÖÖ·ÃÎÊģʽµÄ±íµÄ¿ÉÉìËõÐ ......
in ºÍ existsÆäʵͦºÃÇø±ðµÄ.ÇÒ¿´Ï±߻ù±¾¸ÅÄî¡£
in ÊÇÒ»¸ö¼¯ºÏÔËËã·û.
a in {a,c,d,s,d....}
Õâ¸öÔËËãÖÐ,Ç°ÃæÊÇÒ»¸öÔªËØ,ºóÃæÊÇÒ»¸ö¼¯ºÏ,¼¯ºÏÖеÄÔªËØÀàÐÍÊǺÍÇ°ÃæµÄÔªËØÒ»ÑùµÄ¡£ÊµÏֵĶԼ¯ºÏÖеÄÔªËؽøÐбéÀú£¬ÒÔÈ·¶¨¸ø¶¨µÄÔªËØaÊÇ·ñÓë×Ó²éѯ»òÁбíÖеÄÖµÏàÆ¥Åä¡£
in ÔËËãÓÃÔÚsqlÓï¾äÖÐ,ËüºóÃæ´øµÄselect Ò»¶¨ÊÇÑ¡Ò»¸ ......