社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

Shawn.X

Shawn.X 最近创建的主题
Shawn.X 最近回复了
7 年前
回复了 Shawn.X 创建的主题 » Mysql:如何将表字段更新为从另一个表获取的值[重复]

不需要 join ,只需按以下方式尝试sql:

update TableA set country_code = B.country_code from TableB B where A.country_name = B.country_name 
7 年前
回复了 Shawn.X 创建的主题 » PostgreSQL MySQL中patindex的常见功能

实现这一点有两种方法,示例如下:

postgres=# select strpos('W3Schools.com','Schools');
 strpos 
--------
      3
(1 row)

postgres=# select position('Schools' in 'W3Schools.com');
 position 
----------
        3
(1 row)

postgres=# select regexp_matches('hahahabc123zzz', '(abc)(123)');
 regexp_matches 
----------------
 {abc,123}

postgres=# select array_to_string(regexp_matches('hahahabc123zzz', '(abc)(123)'),' ');
 array_to_string 
-----------------
 abc 123

postgres=# select (regexp_matches('hahahabc123zzz', '(abc)(123)'))[1] as a, (regexp_matches('hahahabc123zzz', '(abc)(123)'))[2] as b;
  a  |  b  
-----+-----
 abc | 123
(1 row)

你想要这个吗? 您可以在这里得到字符串过程的所有函数: https://www.postgresql.org/docs/10/functions-string.html