You are here: Re: SQL help, please « MsSQL Server « IT news, forums, messages
Re: SQL help, please

Posted by Jens on 11/01/05 21:10

select customers.customerid, customers.country,
orders.orderid, orders.orderdate, orderdetails. sum(unitprice) as
TotalSales
from customers, orderdetails --Leave this guy away as you are already
using it in the Join syntax
/*There is no relationaship in a join syntax with orderdetails, as this
is Order id, add the following:
Inner Join orderdetails on Oderdetails.orderId = orders.orderid
*/
left join orders on customers.customerid = orders.customerid
where orderdate > '11/1/4'
and country <> 'USA'
and unitprice > 0
and orderid > 346544
group by orderid
order by orderid


HTH, Jens Suessmeyer.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация