SQL base string and operator use (iii)

Source: Internet
Author: User

SQL Base String Use:

The string can be a character, number, date in the SELECT list

However, dates and characters can only appear in single quotation marks . Each time a row is returned, the string is output once

1. If you want to string the two columns together and add some custom displays as follows:

Select First_Name | | ' is a ' | | job_id as "Emp Details" from employees;

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8D/CB/wKiom1iq00jy0Dl0AABKpjBWPGk191.jpg-wh_500x0-wm_ 3-wmp_4-s_3772435572.jpg "title=" qq20170220182614.jpg "alt=" Wkiom1iq00jy0dl0aabkpjbwpgk191.jpg-wh_50 "/>


2, show first_name People's wages is how much money how to show:

Select First_Name | | ' His salary ' | | Salary as "EMP salary" from employees;

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8D/C9/wKioL1iq1W_S-4XaAABkTUvaU5o014.jpg-wh_500x0-wm_ 3-wmp_4-s_2571567904.jpg "title=" qq20170220182614.jpg "alt=" Wkiol1iq1w_s-4xaaabktuvau5o014.jpg-wh_50 "/>


Second, the reference operator needs to follow the following principles:

1. Specify your own quote delimiter

2. Select any delimiter

3. increase readability and usability

The following examples of our customizations will be higher, thus increasing readability

For example, we want to show what First_Name's annual salary is.

Select First_Name | | Q ' [' s ann-salary is:] ' | | Salary*12 as "emp salary" from employees;

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8D/CC/wKiom1iq2KWiMbf9AABx190fN1Y821.jpg-wh_500x0-wm_ 3-wmp_4-s_434785772.jpg "title=" qq20170220182614.jpg "alt=" Wkiom1iq2kwimbf9aabx190fn1y821.jpg-wh_50 "/>


This article is from the "record a bit of learning life" blog, please make sure to keep this source http://ureysky.blog.51cto.com/2893832/1899626

SQL base string and operator use (iii)

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.