gpt4 book ai didi

mysql - 重新格式化邮政编码以包含空格

转载 作者:行者123 更新时间:2023-11-29 00:09:56 27 4
gpt4 key购买 nike

是否有一个可靠的过程(使用 MySQL)来重新格式化不包含空格的英国邮政编码,以便它们包含空格?

例如:

  • CM75GJ -> CM7 5GJ
  • L269XR -> L26 9XR
  • YO265TD -> YO26 5TD

最佳答案

查看UK postal code formatting并假设没有错误的输入,这应该可以解决问题:

UPDATE address SET postcode =
SUBSTRING(postcode, 1, LEN(postcode)-3) + ' ' +
SUBSTRING(postcode, LEN(postcode)-2, 3)

关于mysql - 重新格式化邮政编码以包含空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25643402/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com