lcase和ucase_在SQL中使用UCASE(),LCASE()和MID()函数
lcase和ucase
Upper Case, Lower Case and MID functions are scalar functions which return a single value, based in the input value.
大寫,小寫和MID函數(shù)是標(biāo)量函數(shù),它們基于輸入值返回單個值。
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:
眾所周知,有時不同的數(shù)據(jù)庫并沒有更多的功能,但是它們的語法有一些細(xì)微的變化。 同樣,對于將字段值轉(zhuǎn)換為大寫,小寫和MID值,對于不同的數(shù)據(jù)庫,存在不同的語法:
Table: Let, we have a table name STUDENT
表格:讓我們有一個表格名稱STUDENT
1)UCASE()函數(shù) (1) UCASE() function)
This function is used to converts a field value to upper case.
此函數(shù)用于將字段值轉(zhuǎn)換為大寫。
SYNTAX:
句法:
SELECT UCASE(column_name) FROM table_name; SELECT UPPER(column_name) FROM table_name;Example:
例:
2)LCASE()函數(shù) (2) LCASE() function)
This function is used to converts a field value to lower case.
此函數(shù)用于將字段值轉(zhuǎn)換為小寫。
SYNTAX:
句法:
SELECT LCASE(column_name) FROM table_name; SELECT LOWER(column_name) FROM table_name;Example:
例:
3)MID()函數(shù) (3) MID() function)
This function is used to extract the char from a text field.
此函數(shù)用于從文本字段中提取字符。
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()函數(shù)中的必需參數(shù)。 它用于提取字段的值。
Where,
哪里,
column_name - is used to extract char.
column_name-用于提取字符。
start - shows the starting point like 0 or 1.
start-顯示起點(diǎn),例如0或1。
length - is to return the number of character.
length-是要返回的字符數(shù)。
AND,
和,
SUBSTRING() function is also used to extract MID() value. Basically, this SUBSTRING() function is used in SQL Server.
SUBSTRING()函數(shù)還用于提取MID()值。 基本上,此SUBSTRING()函數(shù)用于SQL Server。
SYNTAX:
句法:
SELECT SUBSTRING(column_name,start,length) AS name FROM table_name;Conclusion:
結(jié)論:
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!
在本文中,我們學(xué)習(xí)了如何在SQL和SQL查詢中使用UCASE(),LCASE()和MID()函數(shù) ? 我們將更多地了解SQL中其他標(biāo)量函數(shù)的不同或使用。 祝你有美好的一天! 學(xué)習(xí)愉快!
翻譯自: https://www.includehelp.com/sql/Use-of-UCASE-LCASE-and-MID-functions.aspx
lcase和ucase
總結(jié)
以上是生活随笔為你收集整理的lcase和ucase_在SQL中使用UCASE(),LCASE()和MID()函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ruby array_Ruby中带有示例
- 下一篇: flask sql外键使用_如何在SQL