Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of strings and operators on the basis of SQL (3)

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The string based on SQL uses:

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

However, dates and characters can only appear in single quotes. Whenever a line is returned, the string is output once

1. In the process of using the above, if you want to string the two columns together and add some custom display, the following figure:

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

2. How to show how much the salary of the first_name person is?

Select first_name | | 'his salary is' | | salary as "EMP SALARY" from employees

Second, the reference operator should follow the following principles:

1. Specify your own quotation mark separator

2. Select any delimiter

3. Increase readability and availability

The columns below will be more customized to make them more readable

For example, we want to show what the annual salary of first_name is.

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report