×ðÁú¿­Ê±¹ÙÍøµÇ¼

mysqlÖÐ@ÊÇʲôÒâ˼

mysql ÖÐ @ ·ûºÅÓÐÁ½ÖÖÓÃ;£ºÖ¸¶¨±äÁ¿£¨@±äÁ¿Ãû£©ºÍÅþÁ¬±í»òÁÐÃû£¨@±íÃû»ò@ÁÐÃû£© £¬ÌåÏÖÊý¾Ý¿âÖÐÒ»¸öÔÝʱ»òÅÉÉú±íµÄÓÖÃû¡£

MySQL ÖÐ @ ·ûºÅµÄ¼ÄÒå

@ ·ûºÅÔÚ MySQL ÖÐÓÐÁ½ÖÖÖ÷ÒªÓÃ;£º

1. Ö¸¶¨±äÁ¿

@ ·ûºÅÓÃÓÚÖ¸¶¨±äÁ¿ £¬ÆäÓ﷨Ϊ£º

@±äÁ¿Ãû

µÇ¼ºó¸´ÖÆ

ÀýÈ磺

SET @my_variable := 10;

µÇ¼ºó¸´ÖÆ

Õ⽫½¨ÉèÒ»¸öÃûΪ @my_variable µÄ±äÁ¿²¢½«ÆäÖµÉèÖÃΪ 10¡£

2. ÅþÁ¬±í»òÁÐÃû

µ± @ ·ûºÅÓë±íÃû»òÁÐÃûÒ»ÆðʹÓÃʱ £¬ËüÌåÏָù¤¾ßÊÇÊý¾Ý¿âÖÐÒ»¸öÔÝʱ»òÅÉÉú±íµÄÓÖÃû¡£Õâͨ³£ÓëÔÝʱ±í»ò´æ´¢Àú³ÌÒ»ÆðʹÓá£

ÀýÈ磺

SELECT * FROM table_name @alias;

µÇ¼ºó¸´ÖÆ

Õ⽫½¨ÉèÒ»¸öÃûΪ @alias µÄ table_name ±íµÄÓÖÃû¡£

×¢ÖØÊÂÏ

±äÁ¿ÃûÇø·Ö¾Þϸд £¬µ«ÓÖÃû²»Çø·Ö¾Þϸд¡£

ÔÚÖ¸¶¨±äÁ¿Ê± £¬@ ·ûºÅ±ØÐè½ô¸ú±äÁ¿ÃûÇÒûÓпոñ¡£

ÔÚÖ¸¶¨ÓÖÃûʱ £¬@ ·ûºÅ±ØÐèλÓÚ±íÃû»òÁÐÃû֮ǰ¡£

ÒÔÉϾÍÊÇmysqlÖÐ@ÊÇʲôÒâ˼µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ