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

navicatÔõô¿´Íâ¼üÊÓͼ

ÔÚ navicat ÖÐÉó²éÍâ¼üÊÓͼÓÐÈýÖÖÒªÁ죺ֱ½Ó»á¼û£¨²éÕÒÒÔ¡°fk_¡±¿ªÍ·µÄÊÓͼ£©¡¢ÅÌÎÊÊÓͼ£¨´ÓÊÓͼ½ÚµãÓÒ¼üµ¥»÷¡°ÅÌÎÊÊý¾Ý¡±£©£¬»òÕö¿ª information_schema.key_column_usage ±í£¬²¢Ê¹ÓÃÊʵ±µÄɸѡÆ÷À´Ê¶±ðÍâ¼üÒýÓá£

ÔõÑùʹÓà Navicat Éó²éÍâ¼üÊÓͼ

Ö±½Ó»á¼û

ÅþÁ¬µ½Êý¾Ý¿â¡£

ÔÚ¹¤¾ßÊ÷ÖÐÕö¿ª¡°ÊÓͼ¡±½Úµã¡£

²éÕÒÒÔ¡°FK_¡±¿ªÍ·µÄÊÓͼ£¬ÕâЩÊÓͼÌåÏÖÍâ¼ü¹Øϵ¡£

ÅÌÎÊÊÓͼ

ÔÚ¹¤¾ßÊ÷ÖÐÓÒ¼üµ¥»÷¡°ÊÓͼ¡±½Úµã¡£

Ñ¡Ôñ¡°ÅÌÎÊÊý¾Ý¡±¡£

ÔÚ SQL ÅÌÎʱ༭Æ÷ÖУ¬ÊäÈëÒÔÏÂÅÌÎÊ£º

SELECT
  *
FROM
  <view_name></view_name>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ ÊÇÄúÒªÉó²éµÄÍâ¼üÊÓͼµÄÃû³Æ¡£

Õö¿ª INFORMATION_SCHEMA.KEY_COLUMN_USAGE ±í

ÔÚ¹¤¾ßÊ÷ÖÐÕö¿ª¡°ÏµÍ³±í¡±½Úµã¡£

ÕÒµ½²¢Õö¿ª INFORMATION_SCHEMA.KEY_COLUMN_USAGE ±í¡£

ʹÓÃÒÔÏÂɸѡÆ÷Éó²éÍâ¼üÒýÓãº

TABLE_NAME£ºÍâ¼üËùÔڵıí

CONSTRAINT_NAME£ºÍâ¼üÔ¼ÊøµÄÃû³Æ

REFERENCED_TABLE_NAME£ºÒýÓõıí

REFERENCED_COLUMN_NAME£ºÒýÓõÄÁÐ

ʾÀý

¼ÙÉèÎÒÃÇÓÐÒ»¸öÃûΪ Customers µÄ±í£¬ÆäÖаüÀ¨Ò»¸öÃûΪ customer_id µÄÍâ¼ü£¬ËüÒýÓà Orders ±íÖÐµÄ order_id ÁС£

ÒªÉó²é±ðµÄ¼üÊÓͼ£¬ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏ°취£º

Ö±½Ó»á¼û£ºÔÚ¹¤¾ßÊ÷ÖУ¬Õö¿ª¡°ÊÓͼ¡±½Úµã£¬È»ºó²éÕÒÃûΪ FK_Customers_Orders µÄÊÓͼ¡£

ÅÌÎÊÊÓͼ£ºÓÒ¼üµ¥»÷ FK_Customers_Orders ÊÓͼ£¬È»ºóÑ¡Ôñ¡°ÅÌÎÊÊý¾Ý¡±¡£

Õö¿ª INFORMATION_SCHEMA.KEY_COLUMN_USAGE ±í£ºÔÚɸѡÆ÷ÖУ¬Ö¸¶¨ TABLE_NAME Ϊ Customers£¬CONSTRAINT_NAME Ϊ FK_Customers_Orders£¬REFERENCED_TABLE_NAME Ϊ Orders£¬REFERENCED_COLUMN_NAME Ϊ order_id¡£

ÒÔÉϾÍÊÇnavicatÔõô¿´Íâ¼üÊÓͼµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ