From the course: Querying Microsoft SQL Server 2019

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create values with constants

Create values with constants - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2019

Start my 1-month free trial

Create values with constants

- [Instructor] 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 be shown alongside each order. Let's explore some data from a different data table in the AdventureWorks database. I'm going to scroll down until I find the Production schema, and inside of there we'll find a table called Product. I'll open that up so we can see the different columns that make up that table. Now I want to write a simple query that'll return a few columns from this table. We'll start by pressing the new query button to open up a new tab, and I'll say SELECT Name comma Product Number from production dot product. I'll execute the query and in the results we'll see data exactly as it's stored in the original table. Now let's suppose I want to…

Contents