SQL 教程

SQL UCASE() 函数

UCASE() 函数

UCASE() 函数把字段的值转换为大写。

SQL UCASE() 语法

SELECT UCASE(column_name) FROM table_name;

用于 SQL Server 的语法

SELECT UPPER(column_name) FROM table_name;

演示数据库

在本教程中,我们将使用众所周知的 Northwind 样本数据库。

下面是选自 "Customers" 表的数据:

CustomerIDCustomerNameContactNameAddressCityPostalCodeCountry
1

Alfreds FutterkisteMaria AndersObere Str. 57Berlin12209Germany
2Ana Trujillo Emparedados y heladosAna TrujilloAvda. de la Constitución 2222México D.F.05021Mexico
3Antonio Moreno TaqueríaAntonio MorenoMataderos 2312México D.F.05023Mexico
4

Around the HornThomas Hardy120 Hanover Sq.LondonWA1 1DPUK
5Berglunds snabbköpChristina BerglundBerguvsvägen 8LuleåS-958 22Sweden

SQL UCASE() 实例

下面的 SQL 语句从 "Customers" 表中选取 "CustomerName" 和 "City" 列,并把 "CustomerName" 列的值转换为大写:

实例

SELECT UCASE(CustomerName) AS Customer, City
FROM Customers;

新闻动态 联系方式 广告合作 招聘英才 安科实验室 帮助与反馈 About Us

Copyright © 2013 - 2019 Ancii.com All Rights Reserved京ICP备18063983号-5 京公网安备11010802014868号