SQL Basics--mysql 5 (4)

Source: Internet
Author: User
Tags square root

9. Data processing functions

Text Processing: Upper uppercase

Mysql> SelectUid,name,msg,Upper(name) asUppername fromPw_luck;+-----+-----------+------+-----------+|Uid|Name|Msg|Uppername|+-----+-----------+------+-----------+|   0 |Wilson|   - |WILSON||   1 |Zhangsan|   - |Zhangsan||   2 |Lisi| 1001 |LISI||   3 |Wang5| 1001 |WANG5||   7 |Zhangsan7|  + |ZHANGSAN7||   8 |Zhangsan8|  + |ZHANGSAN8||   9 |Zhangsan9|  + |ZHANGSAN9||  Ten |Wang5|  + |WANG5||   One |Wang5%    |  - |WANG5%    ||   A |WANG5|  + |WANG5|+-----+-----------+------+-----------+TenRowsinch Set(0.02Sec

Text processing: Soundex matches all pronunciation-similar items

Mysql> SelectUid,name,msg,Upper(name) fromPw_luckwhere Soundex(name)=Soundex('Wangwu');+-----+--------+------+-------------+|Uid|Name|Msg| Upper(name)|+-----+--------+------+-------------+|   3 |Wang5| 1001 |WANG5||  Ten |Wang5|  + |WANG5||   One |Wang5% |  - |WANG5%      ||   A |WANG5|  + |WANG5|+-----+--------+------+-------------+4Rowsinch Set(0.03Sec

Date and time processing functions

Data () 2012-12-12

Year () 2012

Mounth (2)

Numerical processing: ABS absolute COS cosine exp Index mod remainder sqrt square root

Mysql> Select NAME,MSG,SQRT (msg) from pw_luck;+-----------+------+--------------------+| Name      | msg  | SQRT (msg)          |+-----------+------+--------------------+| Wilson    |  |                 10 | | Zhangsan  |  |                 10 | | Lisi      | 1001 |  31.63858403911275 | | Wang5     | 1001 |  31.63858403911275 | | Zhangsan7 | 1000 | 31.622776601683793 | | Zhangsan8 | 1000 | 31.622776601683793 | | Zhangsan9 | 1000 | 31.622776601683793 | | Wang5 | |     wang5%    | 2000 | 44.721359549995796 | | WANG5     | 31.622776601683793 |+-----------+------+--------------------+10 rows in Set (0.02 sec)

  

SQL Basics--mysql 5 (4)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.