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

¹ØÓÚmysql µÄorder by rand()

 ¹Ù·½ÊÖ²áÉÏÊÇÕâôдµÄ£º
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:ËÎÌå;
mso-font-kerning:1.0pt;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
You cannot
use a column with RAND()
values in an ORDER BY clause, because ORDER BY would evaluate the column
multiple times. However, you can retrieve rows in random order like this:
mysql> SELECT
* from tbl_name
ORDER BY RAND();
ORDER BY
RAND() combined with LIMIT is useful for selecting a random sample from a set
of rows:
mysql> SELECT
* from table1, table2 WHERE a=b AND c<d
-> ORDER BY RAND() LIMIT 1000;
RAND()
is not meant to be a perfect random generator, but instead is a fast way to
generate ad hoc
random numbers which is portable between platforms for
the same MySQL ver


Ïà¹ØÎĵµ£º

MysqlÃüÁî

MySQL ÃüÁîÐÐ
µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö² ......

[MySQL 5.1 ÌåÑé]MySQL ʼþµ÷¶ÈÆ÷(Event Scheduler)

http://hi.baidu.com/tianxia_1209/blog/item/a2613822fec7e7f6d6cae267.html
MYSQLµÄʼþÊÇ5.1ÐÂÔö¼ÓµÄ£¬Èç¹ûÏëÌåÑ飬½¨ÒéÉý¼¶°æ±¾¡£
ÖÁÓÚÓï·¨ÎҾͲ»¶à˵ÁË£¬ÊÖ²áÉϽ²µÄºÜÏêϸ£¬ÎÒÀ´ËµËµ¼¸¸öÒªµãÒÔ¼°Ò»Ð©ÊµÀý¡£
×¢ÒâÊÂÏ
1¡¢EVENTȨÏÞÊÇÕë¶ÔģʽµÄ£¨ÔÚMYSQLÖÐÒ²¾ÍÊÇ¿âµÄ¼¶±ð£©£¬²»ÄܶԵ¥¶À±íÀ´¸³ÓèȨÏÞ¡£
2¡¢±ØÐëÔÚ ......

MySQLÊý¾Ý¿â±¸·ÝµÄ»ù´¡ÖªÊ¶´óÈ«

ƽʱÎÒÃÇÔÚʹÓÃMySQLÊý¾Ý¿âµÄʱºò¾­³£»áÒòΪ²Ù×÷ʧÎóÔì³ÉÊý¾Ý¶ªÊ§£¬MySQLÊý¾Ý¿â±¸·Ý¿ÉÒÔ°ïÖúÎÒÃDZÜÃâÓÉÓÚ¸÷ÖÖÔ­ÒòÔì³ÉµÄÊý¾Ý¶ªÊ§»ò×ÅÊý¾Ý¿âµÄÆäËûÎÊÌâ¡£
¡¡¡¡Ò»¡¢Êý¾Ý±¸·Ý½Ý¾¶
¡¡¡¡ÒòΪÕâ¸ö·½·¨Ã»Óеõ½¹Ù·½ÕýʽÎĵµµÄÑéÖ¤£¬ÎÒÃÇÔݳÆΪÊÔÑé°É¡£
¡¡¡¡Ä¿µÄ£º±¸·ÝhostAÖ÷»úÖÐÒ»¸öMySQLÊý¾Ý¿â±¸·ÝTestA£¬²¢»Ö¸´µ½µ½hostB»úÖÐ ......

ʹÓÃabatorÅäÖÃiBatis£¬¹ÜÀíÊý¾Ý¿â£¨ÒÔMySqlΪÀý£©

ÏàÐźܶàµÄÅóÓѶÔʹÓÃiBatis¹ÜÀíÊý¾Ý¿âºÜ²»Ï°¹ß£¬ÒòΪÎÒÃÇÒªÊÖд´úÂ룬ÌرðÊÇdynamic
query²¿·Ö¸üÊDz»ÖªÈçºÎǶÌ×£¬¶øÕâЩÊÇ¿ÉÒÔÓù¤¾ßµÄ£¡ÏÂÃæ½éÉÜÒ»ÖÖ×î³£Óõģ¡²»·Ï»°ÁË£¬Ö±½ÓÉÏÅäÖùý³Ì£¡
1¡¢»ñµÃ  http://ibatis.apache.org/abator.html
    
Eclipse¿ÉÒÔ×Ô¶¯µÄ½øÐÐUpdate»ñÈ¡´ËPlugin ......

ÀûÓÃmysqlº¯Êý¸üÐÂmemcached

Memcached Functions for MYSQL¹Ù·½Ö÷Ò³£º
https://launchpad.net/memcached-udfs
Á½Æª»ù±¾ÎÄÕ£º
http://www.libing.name/2009/02/06/mysql-map-data-to-memcached.html
http://www.libing.name/2008/02/26/mysql-map-memcached.html
°²×°ºÍÑéÖ¤µÄSQLÓï¾ä£º
http://hg.tangent.org/memcached_functions_mysql/file/7 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ