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

Posted by <freek2000 on 11/03/05 17:07

i must agree hugo, you don't have relationships from first table to second
one
i found some mistake in hugo's sql :)))
instead of
INNER JOIN orderdetails AS od
ON od.orderid - o.orderid (------ minus)

you should use = (eqaual)

:))))





"triciam" <UseLinkToEmail@www.dbforumz.com> wrote in message
news:920152_f847ea0736d966f5148d3bfa6f37dbef@dbforumz.com...
>I am using this query but it’s not working, please help
>
> select customers.customerid, customers.country,
> orders.orderid, orders.orderdate, orderdetails. sum(unitprice) as
> TotalSales
> from customers, orders, orderdetails
> 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
>
> This is the error message that I’m getting:
> ables or functions ’orders’ and ’orders’ have the same exposed names.
> Use correlation names to distinguish them.
> I’m not sure how to make this work......... Thank You Tricia :)
>
> --
> Posted using the http://www.dbforumz.com interface, at author's request
> Articles individually checked for conformance to usenet standards
> Topic URL: http://www.dbforumz.com/SQL-help-ftopict267876.html
> Visit Topic URL to contact author (reg. req'd). Report abuse:
> http://www.dbforumz.com/eform.php?p=920152

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация