0

Whether both gives same result or different ??

SELECT FirstName, UPPER(LastName) AS LastName FROM employees; As SELECT FirstName, UPPER(LastName) FROM employees;

19th Dec 2019, 5:39 PM
Lakshmi Reddy Sanikommu
Lakshmi Reddy Sanikommu - avatar
5 Answers
+ 2
You use "AS" just to change the column name at the time of display. So you should get pretty much the same result for both queries.
19th Dec 2019, 5:43 PM
Avinesh
Avinesh - avatar
+ 2
query will select same data . but resulting column names will be different. for example, first query will have resulting column name `LastName`(you renamed it using AS) where as second query will have resulting column name UPPER(LastName) actual column names may vary slightly, it's just an example. You can use AS keyword when your resulting column names are too long. It just renames resulting column doesn't change it's content. You can search for AS keyword on net.
19th Dec 2019, 5:47 PM
šŸ‡®šŸ‡³OmkaršŸ•‰
šŸ‡®šŸ‡³OmkaršŸ•‰ - avatar
+ 1
lucky Read what šŸ‡®šŸ‡³OmkaršŸ•‰ has mentioned, the answer is there.
19th Dec 2019, 5:53 PM
Avinesh
Avinesh - avatar
0
Then at the time of display for the second code whether it displays or not ? If displays what's the column name ?
19th Dec 2019, 5:49 PM
Lakshmi Reddy Sanikommu
Lakshmi Reddy Sanikommu - avatar
0
Ok bruh !! TQ
19th Dec 2019, 5:55 PM
Lakshmi Reddy Sanikommu
Lakshmi Reddy Sanikommu - avatar