MySQLÓï¾äÓÅ»¯µÄ»ù±¾ÔÔò
MySQLÓï¾äÓÅ»¯µÄ»ù±¾ÔÔò£º
¡ô1¡¢Ê¹ÓÃË÷ÒýÀ´¸ü¿ìµØ±éÀú±í¡£
ȱʡÇé¿öϽ¨Á¢µÄË÷ÒýÊÇ·ÇȺ¼¯Ë÷Òý£¬µ«ÓÐʱËü²¢²»ÊÇ×î¼ÑµÄ¡£ÔÚ·ÇȺ¼¯Ë÷ÒýÏ£¬Êý¾ÝÔÚÎïÀíÉÏËæ»ú´æ·ÅÔÚÊý¾ÝÒ³ÉÏ¡£ºÏÀíµÄË÷ÒýÉè¼ÆÒª½¨Á¢ÔÚ¶Ô¸÷ÖÖ²éѯµÄ·ÖÎöºÍÔ¤²âÉÏ¡£Ò»°ãÀ´Ëµ£º
a.ÓдóÁ¿Öظ´Öµ¡¢ÇÒ¾³£Óз¶Î§²éѯ£¨ > ,< £¬> =,< =£©ºÍorder by¡¢group by·¢ÉúµÄÁУ¬¿É¿¼Âǽ¨Á¢Èº¼¯Ë÷Òý£»
b.¾³£Í¬Ê±´æÈ¡¶àÁУ¬ÇÒÿÁж¼º¬ÓÐÖظ´Öµ¿É¿¼Âǽ¨Á¢×éºÏË÷Òý£»
c.×éºÏË÷ÒýÒª¾¡Á¿Ê¹¹Ø¼ü²éѯÐγÉË÷Òý¸²¸Ç£¬ÆäÇ°µ¼ÁÐÒ»¶¨ÊÇʹÓÃ×îƵ·±µÄÁС£Ë÷ÒýËäÓÐÖúÓÚÌá¸ßÐÔÄܵ«²»ÊÇË÷ÒýÔ½¶àÔ½ºÃ£¬Ç¡ºÃÏà·´¹ý¶àµÄË÷Òý»áµ¼ÖÂϵͳµÍЧ¡£Óû§ÔÚ±íÖÐÿ¼Ó½øÒ»¸öË÷Òý£¬Î¬»¤Ë÷Òý¼¯ºÏ¾ÍÒª×öÏàÓ¦µÄ¸üй¤×÷¡£
¡ô2¡¢ÔÚº£Á¿²éѯʱ¾¡Á¿ÉÙÓøñʽת»»¡£
¡ô3¡¢ORDER BYºÍGROPU BYʹÓÃORDER BYºÍGROUP BY¶ÌÓÈκÎÒ»ÖÖË÷Òý¶¼ÓÐÖúÓÚSELECTµÄÐÔÄÜÌá¸ß¡£
¡ô4¡¢ÈκζÔÁеIJÙ×÷¶¼½«µ¼Ö±íɨÃ裬Ëü°üÀ¨Êý¾Ý¿âº¯Êý¡¢¼ÆËã±í´ïʽµÈµÈ£¬²éѯʱҪ¾¡¿ÉÄܽ«²Ù×÷ÒÆÖÁµÈºÅÓұߡ£
¡ô5¡¢IN¡¢OR×Ӿ䳣»áʹÓù¤×÷±í£¬Ê¹Ë÷ÒýʧЧ¡£Èç¹û²»²úÉú´óÁ¿Öظ´Öµ£¬¿ÉÒÔ¿¼ÂÇ°Ñ×Ó¾ä²ð¿ª¡£²ð¿ªµÄ×Ó¾äÖÐÓ¦¸Ã°üº¬Ë÷Òý¡£
¡ô6¡¢Ö»ÒªÄÜÂú×ãÄãµÄÐèÇó£¬Ó¦¾¡¿ÉÄÜʹÓøüСµÄÊý¾ÝÀàÐÍ£ºÀýÈçʹÓÃMEDIUMINT´úÌæINT
¡ô7¡¢¾¡Á¿°ÑËùÓеÄÁÐÉèÖÃΪNOT NULL£¬Èç¹ûÄãÒª±£´æNULL£¬ÊÖ¶¯È¥ÉèÖÃËü£¬¶ø²»ÊÇ°ÑËüÉèΪĬÈÏÖµ¡£
¡¡¡¡
¡ô8¡¢¾¡Á¿ÉÙÓÃVARCHAR¡¢TEXT¡¢BLOBÀàÐÍ
¡ô9¡¢Èç¹ûÄãµÄÊý¾ÝÖ»ÓÐÄãËùÖªµÄÉÙÁ¿µÄ¼¸¸ö¡£×îºÃʹÓÃENUMÀàÐÍ
¡ô10¡¢ÕýÈçgraymiceËù½²µÄÄÇÑù£¬½¨Á¢Ë÷Òý¡£
ÒÔÏÂÊÇÎÒ×öµÄÒ»¸öʵÑ飬¿ÉÒÔ·¢ÏÖË÷ÒýÄܼ«´óµØÌá¸ß²éѯµÄЧÂÊ£º
ÎÒÓÐÒ»¸ö»áÔ±ÐÅÏ¢±íusers£¬Àï±ßÓÐ37365ÌõÓû§¼Ç¼£º
ÔÚ²»¼ÓË÷ÒýµÄʱºò½øÐвéѯ£º
sqlÓï¾äA:
select * from users where username like '%Ðí%';
ÔÚMysql-FrontÖеÄ8´Î²éѯʱ³¤Îª£º1.40,0.54,0.54,0.54,0.53,0.55,0.54 ¹²ÕÒµ½960Ìõ¼Ç¼
sqlÓï¾äB:
select * from users where username like 'Ðí%';
ÔÚMysql-FrontÖеÄ8´Î²éѯʱ³¤Îª£º0.53,0.53,0.53,0.54,0.53,0.53,0.54,0.54 ¹²ÕÒµ½836Ìõ¼Ç¼
sqlÓï¾äC:
select * from users where username like '%Ðí';
ÔÚMysql-FrontÖеÄ8´Î²éѯʱ³¤Îª£º0.51,0.51,0.52,0.52,0.51,0.51,0.52,0.51 ¹²ÕÒµ½7Ìõ¼Ç¼
Ϊusername
Ïà¹ØÎĵµ£º
how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE 9.2, 9.3, 10.0 & 10.1 operating systems, but most of the steps ought to be valid for all Linux-lik ......
DELIMITER $$
DROP PROCEDURE IF EXISTS `heli`.`prodtest` $$
CREATE PROCEDURE `heli`.`prodtest` ()
BEGIN
/*¾Ö²¿±äÁ¿µÄ¶¨Òå declare*/
declare pid varchar(45) default '';
declare pq int default 0;
declare pk double default 0.0;
declare cur1 CURSOR FOR SELECT pro ......
MySQLÓï¾äÓÅ»¯µÄ»ù±¾ÔÔò£º
¡ô1¡¢Ê¹ÓÃË÷ÒýÀ´¸ü¿ìµØ±éÀú±í¡£
ȱʡÇé¿öϽ¨Á¢µÄË÷ÒýÊÇ·ÇȺ¼¯Ë÷Òý£¬µ«ÓÐʱËü²¢²»ÊÇ×î¼ÑµÄ¡£ÔÚ·ÇȺ¼¯Ë÷ÒýÏ£¬Êý¾ÝÔÚÎïÀíÉÏËæ»ú´æ·ÅÔÚÊý¾ÝÒ³ÉÏ¡£ºÏÀíµÄË÷ÒýÉè¼ÆÒª½¨Á¢ÔÚ¶Ô¸÷ÖÖ²éѯµÄ·ÖÎöºÍÔ¤²âÉÏ¡£Ò»°ãÀ´Ëµ£º
a.ÓдóÁ¿Öظ´Öµ¡¢ÇÒ¾³£Óз¶Î§²éѯ£¨ > ,< £¬> =,& ......
ÏÖÔÚ´ó¸ÅÁгöÈçÏÂ:
1.Êý¾Ý¿âµÄÉè¼Æ
¾¡Á¿°ÑÊý¾Ý¿âÉè¼ÆµÄ¸üСµÄÕ¼´ÅÅÌ¿Õ¼ä.
1).¾¡¿ÉÄÜʹÓøüСµÄÕûÊýÀàÐÍ.(mediumint¾Í±Èint¸üºÏÊÊ).
2).¾¡¿ÉÄܵĶ¨Òå×Ö¶ÎΪnot null,³ý·ÇÕâ¸ö×Ö¶ÎÐèÒªnull.
3).Èç¹ûûÓÐÓõ½±ä³¤×ֶεĻ°±ÈÈçvarchar,ÄǾͲÉÓù̶¨´óСµÄ¼Í¼¸ñʽ±ÈÈçchar.
4).±íµÄÖ÷Ë÷ÒýÓ¦¸Ã¾¡¿ÉÄܵĶÌ.ÕâÑùµÄ»°Ã¿Ìõ¼Í¼ ......
½ñÌìµÄѧϰÄÚÈÝÊÇsqliteºÍPDO mysql¡£
ÓÃ×Ô¼ºµÄ»°ËµËµÁ½¸ö¶«Î÷°É£º
sqliteËãÊÇÒ»ÖÖ²»ÏµÍ³µÄÊý¾Ý¿â´æ´¢·½Ê½£¬ËüµÄ´æ·Å¸ñʽÊÇÒ»¸ö.dbºó׺µÄÎļþ£¬ÔÚphpÖÐËü´æ·ÅÔÚµ±Ç°µÄĿ¼Ï£¬Ã²ËƲ»ÓÃÓû§ÃûÃÜÂ룬°²È«ÐԽϵͣ¬È´±È½Ï·½±ã¡£PHP5ÖÐ×Ô´øµÄһЩϵͳº¯Êý£¬¶¼ÊÇÒÔsqlite_¿ªÍ·µÄ¡£
PDOÈ«³ÆPHP Data Object£¬¹ËÃû˼Òå¾ÍÊÇPHPµÄÒ ......