Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gully24
Starting Member
2 Posts |
Posted - 2012-02-13 : 00:30:21
|
| Trying to understand the inner and outer Joins any help with this Query would help me greatly thanks in advance.Write query, the customers and orders table, that will show all of the customers with the orders they have placed – if they have placed an order or not in customer id order? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2012-02-13 : 03:57:00
|
| What have you got so far?I'm not going to do your homework for you.--Gail ShawSQL Server MVP |
 |
|
|
gully24
Starting Member
2 Posts |
Posted - 2012-02-13 : 09:56:46
|
| SELECT *FROM Orders o RIGHT OUTER JOIN Customers c ON c.CustomerID = o.CustomerID ORDER BY c.CustomerID--PART2----SELECT c.CustomerID,o.*--FROM Orders o --RIGHT OUTER JOIN Customers c --ON c.CustomerID = o.CustomerID --WHERE o.CustomerID IS NULL--ORDER BY c.CustomerID |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2012-02-13 : 10:00:48
|
| Ok, and what's wrong with those? What are they not doing that they should, etc?p.s. The second is looking for orders that don't have customers. Is that even possible?--Gail ShawSQL Server MVP |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|