How custom column name generated? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How custom column name generated?

He didn't give SQRT(cost) as SQRT(cost) in query. but column name came as SQRT(cost) .. somebody please explain ? thanks in advance :-)

18th Jul 2015, 2:10 PM
Rahul Sounder
Rahul Sounder - avatar
3 Answers
0
it's by default what ever function we use mysql assume it as a column name
9th Oct 2015, 1:32 PM
Viral Mistry
Viral Mistry - avatar
0
That's the default name.. Whatever function statement you use will be assigned as name to the column. Of it should be renamed, we can use SQRT(number) AS SquareRoot
21st Nov 2015, 3:16 PM
Vishnu Priya P
Vishnu Priya P - avatar
0
unless and until you are not giving any name for column after AS, SQL will take same name as you typed after SELECT statment.
29th Jul 2016, 5:16 AM
keshav bhardwaj
keshav bhardwaj - avatar