This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
I'd like to select a customer that never made a sale
Joined: Aug 02, 2012
Oct 09, 2013 04:12:36
select c.CustomerID AS '客戶ID' , c.LastName AS '姓氏',FirstName AS '名字', c.FixedPhoneNumber AS '固定电话号码' from customer c INNER JOIN orders o ON (c.CustomerID = o.CustomerID) INNER JOIN order_details od ON (o.OrderID = od.OrderID) group by c.CustomerID having sum(od.NetSales) < 50000
As you see, if the customer never made a sale, the resultset will not be
included, how can I make it included?
Joined: Aug 22, 2010
Oct 09, 2013 04:20:11
An outer join should do the trick again, as it did
This time it is a bit more complicated, since you need to combine inner and outer joins in your query. I'd suggest googling
combining inner and outer join
subject: I'd like to select a customer that never made a sale
Stumped on a SQL Statement
Oracle : Inner Join syntax
Same query, different results
How to get the last purchased product?
SQLite abs yields results of nulls
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014