0
while suming all salaries why we are not using asterisk *
2 odpowiedzi
+ 2
you have a table like
name-salary
a-34
b-39
c-65
if you use * then all column will be selected.
but you can't sum name because it's char
.you only sum integer so you need to use sum(salary) which only select salary and sum up it
+ 1
In sql '*' means all. But when you want to sum all salaries you need an arithmetic operator, without an arithmetic operator how can you sum all salaries in general mathematics. But in sql you just need an function which will perform same as that arithmetic operator to produce summation of given numbers and the function is SUM.
and the syntax is:
SELECT SUM('salaries')FROM employees;