Empowering CS learners, aspiring programmers, and startups with AI, Data Science & Programming insights — scaling skills from learning foundations to enterprise-grade solutions.
Creating temporary columns with SELECT
›Forums›SQL›Creating temporary columns with SELECT
Write and run a query, with no starter code or hints to answer this question:What is the Biweekly High Rate minus the Biweekly Low Rate for job Code 0170?
So, I need to form a temporary column that will hold value of Biweekly High Rate – Biweekly Low Rate for job Code 0170.
With SELECT, how to mention such temporary columns?
SELECT
my_height_in_inch*2.54 AS my_height_in_cm,
my_height_in_inch - your_height_in_inches AS height_difference,
'cat' AS foo, /* in case need to have a static string somewhere for some reason */
NULL AS emp_column /* to have a column of empty data because maybe I am importing this into Excel */