PostgreSQL
SELECT
substring(cm_cust_no,1,4) AS cust_no_short
FROM
"cus"
WHERE
cm_term != 'abc'
AND cm_term != 'def'
AND cm_term != '123'
AND cm_term != 'ar'
MySQL
SUBSTRING(string, start, length) OR
SUBSTRING(string FROM start FOR length)文章来源:https://www.toymoban.com/news/detail-810311.html
SELECT SUBSTRING("SQL Tutorial", 5, 3) AS ExtractString;
SELECT SUBSTRING(cus_code, 1,4) AS ExtractString FROM biz_cus;
或者 Left文章来源地址https://www.toymoban.com/news/detail-810311.html
SELECT LEFT(CustomerName, 5) AS ExtractString FROM Customers;
到了这里,关于MySQL && PostgreSQL截取substring的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!