当前位置:网站首页>Chapter 1 SQL operators

Chapter 1 SQL operators

2022-06-10 18:54:00 yaoxin521123

Chapter one SQL The operator

SQL The operator Symbol (-)

Unary operator that returns an expression as a negative number .

The outline

-expression

Parameters

  • expression - Numerical expression .

describe

Unary operators operate on only one expression of any data type of the numeric data type category .

– yes SQL Expand .

Example

The following example returns three numeric fields : Sample.Person Medium Age Column ; – Age Average ( negative ) value ; And age minus average age :

SELECT Age,
       -(AVG(age)) AS NegAvg,
       Age-AVG(Age) AS AgeRelAvg
FROM Sample.Person

 Insert picture description here

SQL The operator Symbol (+)

Unary operator that returns an expression as a positive value .

The outline

+expression

Parameters

  • expression - Numerical expression .

describe

Unary operators operate on only one expression . This expression can be any data type of the numeric data type category .
+( just ) It's a SQL Expand .

原网站

版权声明
本文为[yaoxin521123]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101807316357.html