尊龙凯时人生就是博

mysqlÖÐfieldÊÇʲôÒâ˼

mysql ÖÐ field Òªº¦×ÖÓÃÓÚÔÚ±íÖвéÕÒÁеÄÐòºÅ £¬Í¨¹ýÖ¸¶¨±í´ïʽºÍÒª½ÏÁ¿µÄÁÐÃû £¬¼´¿É·µ»ØÆ¥ÅäÁеÄË÷Òý £¬²»È»·µ»Ø 0 »ò null £¬³£ÓÃÓÚ¶¯Ì¬ sql ºÍÈ·¶¨ÁÐ˳Ðò¡£

MySQL ÖÐµÄ FIELD

FIELD ÊÇ MySQL ÖеÄÒ»¸öÒªº¦×Ö £¬ÓÃÓÚÔÚ SELECT Óï¾äÖмìË÷±íÖÐÁеÄÐòºÅ£¨Ë÷Òý£©¡£

ÓÃ;

·µ»ØÖ¸¶¨ÁÐÔÚ±íÖеÄË÷Òý¡£

È·¶¨ÁÐÔÚ±íÖеÄλÖá£

ÓÃÓÚ¶¯Ì¬ SQL Óï¾äÖÐ £¬ÆäÖÐÐèҪƾ֤Ìõ¼þÒýÓÃÌض¨µÄÁС£

Óï·¨

FIELD(expr, col1, col2, ..., coln)

µÇ¼ºó¸´ÖÆ

ÆäÖУº

expr ÊÇÒª¼ìË÷ÆäË÷ÒýµÄ±í´ïʽ»òÁÐÃû¡£

col1, col2, …, coln ÊÇÓÃÓÚÈ·¶¨Ë÷ÒýµÄÁÐÃûµÄÁбí¡£

ʾÀý

ÔÚÃûΪ “employees” µÄ±íÖÐ £¬»ñÈ¡ “last_name” ÁеÄË÷Òý£º

SELECT FIELD('Smith', last_name) FROM employees;

µÇ¼ºó¸´ÖÆ

˵Ã÷

ÈôÊÇ expr ÓëÈκΠcoln Æ¥Åä £¬Ôò·µ»ØÆäË÷Òý¡£

ÈôÊÇ expr ÓëÈκΠcoln ²»Æ¥Åä £¬Ôò·µ»Ø 0¡£

ÈôÊÇ expr Ϊ NULL £¬Ôò·µ»Ø NULL¡£

Óŵã

ÔÚ±àд¶¯Ì¬ SQL Óï¾äʱºÜÓÐÓà £¬ÕâЩÓï¾äÐèҪƾ֤Ìõ¼þÒýÓÃÌض¨ÁС£

¿ÉÒÔÓÃÀ´È·¶¨±íÖÐÁеÄ˳Ðò¡£

ÌṩÁËÒ»ÖÖ¼òÆÓµÄÒªÁìÀ´¼ìË÷ÁеÄË÷Òý £¬¶øÎÞÐèʹÓÃÖØ´óµÄ×ÓÅÌÎÊ»òÅþÁ¬¡£

×¢ÖØÊÂÏî

FIELD ²»¿ÉÓÃÓÚ GROUP BY »ò ORDER BY ×Ӿ䡣

FIELD »áµ¼ÖÂÌØÁíÍâÊý¾Ý´¦Àí¿ªÏú £¬Òò´ËÔÚÐèÒª¸ßÐÔÄܵÄÅÌÎÊÖÐÓ¦ÉóÉ÷ʹÓá£

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

13452372176

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

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

QR code
sitemap¡¢ÍøÕ¾µØͼ