0
[SOLVED] Is this valid if valid tell reason ?
Select 'total sal' sal+commission from emp;
4 Answers
+ 1
/ As my experience it's invalid ,You can use this
Select sal, commission from emp;
0
Can you please take care that your code example is properly formatted?
Also tell us the language.
And tags are meant as keywords to look up your question. Putting your name there doesn't make sense.
0
Language is SQL
0
You can include a column name inside quotes so that is fine but there shouldn't be space in between them.
And as long as sal and commision are numerical values then they should work as well.
It should return the sum of each record.
It would be better if you use-
Select sal+commission AS totalSal from emp;
It just enhances readability.