如题所述
ä¸è¬æ¥è¯´ï¼SQLç±»æ°æ®åºé½ä¼æä¸ç§å符串类åï¼åºå®é¿åº¦çcharï¼éå®æ大é¿åº¦çvarcharï¼å¯åé¿åº¦çtextã
ããå¨ä½¿ç¨MySqlçæ¶åï¼æ们é常ä¼è¢«åç¥ï¼ä½¿ç¨ææ大é¿åº¦çcharæè varcharä¼å¨æ§è½æ¹é¢æ好å¤ï¼èå¨PostgreSQLä¸ï¼å´ä¸ä¸å®æ¯è¿æ ·ã
ããå¨PostgreSQLä¸ï¼è¿ä¸ç§ç±»åçå符串æ°æ®å¹¶æ²¡æææ¾çæ§è½å·®å«ï¼èä¸character(n)ç±»åçæ°æ®ä¸è¬æ¯ææ ¢çï¼å 为åºå®é¿åº¦å¯¼è´æ´å¤çåå¨ç©ºé´ãæ以ï¼ä¸è¬æ¥è¯´ï¼textæè character varyingå°±è¡äºã
ããå¨ä½¿ç¨MySqlçæ¶åï¼æ们é常ä¼è¢«åç¥ï¼ä½¿ç¨ææ大é¿åº¦çcharæè varcharä¼å¨æ§è½æ¹é¢æ好å¤ï¼èå¨PostgreSQLä¸ï¼å´ä¸ä¸å®æ¯è¿æ ·ã
ããå¨PostgreSQLä¸ï¼è¿ä¸ç§ç±»åçå符串æ°æ®å¹¶æ²¡æææ¾çæ§è½å·®å«ï¼èä¸character(n)ç±»åçæ°æ®ä¸è¬æ¯ææ ¢çï¼å 为åºå®é¿åº¦å¯¼è´æ´å¤çåå¨ç©ºé´ãæ以ï¼ä¸è¬æ¥è¯´ï¼textæè character varyingå°±è¡äºã
温馨提示:答案为网友推荐,仅供参考