From the course: Querying Microsoft SQL Server 2022

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Create values with constants and math

Create values with constants and math - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2022

Create values with constants and math

- Sometimes it's beneficial to return a column of values in your results that don't actually exist in the original table. For instance, if you're building a report and you need each record to be associated with the same company or the same tax rate to show alongside each order. Let's explore some data from a different table now. Let me go ahead and minimize the human resources dot department table and I'll scroll down to the production schema. We'll find a table called production dot product. There's a lot of different columns in here but we're only going to pull out a few of 'em. I'll write a simple query that returns a couple of these columns. We'll start by pressing the new query button. Then I'll type in select, name, comma, and online number two, the second column, product number. I don't need a column after this one because it's going to be the last column that we're typing up. So I'll come down to line number three.…

Contents