lcase和ucase
Upper Case, Lower Case and MID functions are scalar functions which return a single value, based in the input value.
大寫,小寫和MID函數是標量函數,它們基于輸入值返回單個值。
As you all know sometimes different databases have not more but, have some minor changes in their syntax's. Similarly, for convert a field value to the upper case, lower case and for MID value different syntax are there for the different database:
眾所周知,有時不同的數據庫并沒有更多的功能,但是它們的語法有一些細微的變化。 同樣,對于將字段值轉換為大寫,小寫和MID值,對于不同的數據庫,存在不同的語法:
Table: Let, we have a table name STUDENT
表格:讓我們有一個表格名稱STUDENT

1)UCASE()函數 (1) UCASE() function)
This function is used to converts a field value to upper case.
此函數用于將字段值轉換為大寫。
SYNTAX:
句法:
SELECT UCASE(column_name) FROM table_name;
SELECT UPPER(column_name) FROM table_name;
Example:
例:
2)LCASE()函數 (2) LCASE() function)
This function is used to converts a field value to lower case.
此函數用于將字段值轉換為小寫。
SYNTAX:
句法:
SELECT LCASE(column_name) FROM table_name;
SELECT LOWER(column_name) FROM table_name;
Example:
例:
3)MID()函數 (3) MID() function)
This function is used to extract the char from a text field.
此函數用于從文本字段中提取字符。
SYNTAX:
句法:
SELECT MID(column_name,start,length) AS some_name FROM table_name;
column_name, start, length are the required parameters in MID() function. It is used to extract values of a field.
column_name , start , length是MID()函數中的必需參數。 它用于提取字段的值。
Where,
哪里,
column_name - is used to extract char.
column_name-用于提取字符。
start - shows the starting point like 0 or 1.
start-顯示起點,例如0或1。
length - is to return the number of character.
length-是要返回的字符數。
AND,
和,
SUBSTRING() function is also used to extract MID() value. Basically, this SUBSTRING() function is used in SQL Server.
SUBSTRING()函數還用于提取MID()值。 基本上,此SUBSTRING()函數用于SQL Server。
SYNTAX:
句法:
SELECT SUBSTRING(column_name,start,length) AS name FROM table_name;
Conclusion:
結論:
In this article, we have learned how to use UCASE(), LCASE() and MID() functions in SQL and SQL queries? We will know more about different or use of another scalar function in SQL. Have a great day! Happy Learning!
在本文中,我們學習了如何在SQL和SQL查詢中使用UCASE(),LCASE()和MID()函數 ? 我們將更多地了解SQL中其他標量函數的不同或使用。 祝你有美好的一天! 學習愉快!
翻譯自: https://www.includehelp.com/sql/Use-of-UCASE-LCASE-and-MID-functions.aspx
lcase和ucase