mysqlµÄÒ»¸öСÀý×Ó
×î´óµÄÎïÆ·ºÅÊÇʲô£¿
SELECT MAX(article) AS article from shop;
ÈÎÎñ£ºÕÒ³ö×î¹óÎïÆ·µÄ±àºÅ¡¢ÏúÊÛÉ̺ͼ۸ñ¡£
ÕâºÜÈÝÒ×ÓÃÒ»¸ö×Ó²éѯ×öµ½£º
SELECT article, dealer, price
from shop
WHERE price=(SELECT MAX(price) from shop);
ÁíÒ»¸ö½â¾ö·½°¸ÊÇ°´¼Û¸ñ½µÐòÅÅÐòËùÓÐÐв¢ÓÃMySQLÌض¨LIMIT×Ó¾äÖ»µÃµ½µÚÒ»ÐУº
SELECT article, dealer, price
from shop
ORDER BY price DESC
LIMIT 1;
×¢:Èç¹ûÓжàÏî×î¹óµÄÎïÆ·( ÀýÈçÿ¸öµÄ¼Û¸ñΪ19.95)£¬LIMIT½â¾ö·½°¸½ö½öÏÔʾÆäÖÐÒ»¸ö£¡
Ïà¹ØÎĵµ£º
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON bankaccount.*
-> TO 'custom'@'localhost'
-> IDENTIFIED BY 'password';
mysql> GRANT SELECT,INS ......
MysqlÊý¾Ý¿âÊÇÒ»¸ö¶àÓû§£¬¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â£¬ÊÇÒ»¸ö¿Í»§»ú/·þÎñÆ÷½á¹¹µÄÓ¦ÓóÌÐò¡£ËüÊǶԸöÈËÓû§ºÍÉÌÒµÓû§ÊÇÃâ·ÑµÄ.
¡¡¡¡MysqlÊý¾Ý¿â¾ßÓÐÒÔÏÂÓŵ㣺
¡¡¡¡1.ͬʱ·ÃÎÊÊý¾Ý¿âµÄÓû§µÄÊýÁ¿²»ÊÜÏÞÖÆ
¡¡¡¡2.¿ÉÒÔ±£´æ³¬¹ý5ǧÍòÌõµÄ¼Ç¼
¡¡¡¡3.ÊÇÄ¿Ç°Êг¡ÉÏÏÖÓÐÊý¾Ý¿â²úÆ·ÖÐÔËÐÐËÙ¶È×î¿ìµÄÊý¾Ý¿âϵͳ
¡¡¡¡4.Óû§È¨ÏÞ ......
MySQL³£ÓõĴ洢ÒýÇæΪMyISAM¡¢InnoDB¡¢MEMORY¡¢MERGE£¬ÆäÖÐInnoDBÌṩÊÂÎñ°²È«±í£¬ÆäËû´æ´¢ÒýÇ涼ÊÇ·ÇÊÂÎñ°²È«±í¡£
MyISAMÊÇMySQLµÄĬÈÏ´æ´¢ÒýÇæ¡£MyISAM²»Ö§³ÖÊÂÎñ¡¢Ò²²»Ö§³ÖÍâ¼ü£¬µ«Æä·ÃÎÊËٶȿ죬¶ÔÊÂÎñÍêÕûÐÔûÓÐÒªÇó¡£
InnoDB´æ´¢ÒýÇæÌṩÁ˾ßÓÐÌá½»¡¢»Ø¹öºÍ±ÀÀ£»Ö¸´ÄÜÁ¦µÄÊÂÎñ°²È«¡£µ«ÊDZÈÆðMyISAM´æ´ ......