How to Write a SQL Statement with Results in the Query

I am attempting to write a query that will be run inside of a program to test the logic within the program, and I need to know how to write a query to return more than one row in a result set to test out the logic within the code that I have written. The code does work with one example, but I need to have the SQL code pass in more than one row of data. Starting with the query: Select '3M' As Customer, '35.90' As PurchasePrice, 'DVD Tutorial' As ProductDescription;
How would I return a result set using SQL inside of a SQL Server 2005 database engine that will show me data on five customers that would also include a purchase price and a Product description with the SQL code. Again, the data from the SQL statement is taking the place in a test scenario of having a database connection made and run through an inner joining of tables that are not yet populated with data. As a result, I have to come up with a set of data. You can assume that all of these fields are being returned as strings. Thanks in advance for the help.
thenthorn1010Asked:
Who is Participating?
 
Ron MalmsteadConnect With a Mentor Information Services ManagerCommented:
Select '3M' As Customer, '35.90' As PurchasePrice, 'DVD Tutorial' As ProductDescription
UNION ALL
Select '3M' As Customer, '35.90' As PurchasePrice, 'DVD Tutorial' As ProductDescription
UNION ALL
Select '3M' As Customer, '35.90' As PurchasePrice, 'DVD Tutorial' As ProductDescription
0
 
thenthorn1010Author Commented:
Thank you for the great example. This was exactly what I was looking for to solve my data testing issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.