Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个表,其中有一列包含字符串,其中前两个字母是国家标识符(US、CN、RU 等),接下来的 3 个字符是我要捕获的标识符。有没有办法做到这一点?
你试过这个吗?
SELECT SUBSTRING(column, 3, 3) ...
这是SQLFiddle。
SELECT SUBSTRING(column, 1, 2) [country] , SUBSTRING(column, 3, 3) [identifier] FROM table
SELECT SUBSTRING(field, 3, 3) from table;
从表中选择子字符串(列,3,3)