troubleshooting Question

sql to add additional rows

Avatar of johnnyg123
johnnyg123Flag for United States of America asked on
SQLMicrosoft SQL Server
6 Comments1 Solution25 ViewsLast Modified:
Here is some sample data from the order and customer tables (SQL Server 2014)

Order Table
OrderID  OrderAmount    
1              300    
2              400          


Customer Table
CustomerID  CustomerFirstName CustomerLastName
500                Fred                          Smith

Need to write a query that will return all rows from customer table with a row for each order that exists

Given sample data would like query to return the following

CustomerID  CustomerFirstName CustomerLastName OrderID  OrderAmount
500                Fred                          Smith                        1             300
500                Fred                          Smith                        2             400

Not sure of best way to do this


ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros