From the course: Learning Microsoft SQL Server 2022

Unlock the full course today

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

Solution: Select data from a table

Solution: Select data from a table - SQL Server Tutorial

From the course: Learning Microsoft SQL Server 2022

Solution: Select data from a table

- [Instructor] In this first challenge, we were tasked with reviewing some expense data about our organization. We need to retrieve records about office supply purchases and sort the data so that the most recent purchases are at the top of the results. I'll start by running the SELECT statement that we're given. That'll just select everything from the Expenses table, and we can see all the raw data that we have to work with. Includes all these different columns, and lots of different rows of data that are in this table. The first step of the challenge is to retrieve just the columns that don't include the AMOUNT column, so I want all the other columns. So, I want EXPENSEID, DATE, CATEGORY. I do not want this AMOUNT column to show in the final results, but I do want the DESCRIPTION. So, we need to modify this SELECT statement. Instead of returning all of the columns with this asterisk character, we just need to list out the columns that we do want. So, I'll say ExpenseID, comma Date…

Contents