elliminate the dups

Last Post 04 Nov 2008 07:57 PM by rodchar. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
rodchar
New Member
New Member

--
29 Oct 2008 07:18 PM
hi all,

given:
with CustomerAndOrderDetails AS
(
SELECT Customers.CompanyName
, Customers.ContactName
, CONVERT(char(10)
, Orders.OrderDate, 101) AS OrderDate
, Products.ProductName
FROM Customers INNER JOIN
Orders ON Customers.CustomerID = Orders.CustomerID INNER JOIN
[Order Details] ON Orders.OrderID = [Order Details].OrderID INNER JOIN
Products ON [Order Details].ProductID = Products.ProductID
)
select * from CustomerAndOrderDetails
where productname like 'Aniseed%'
order by companyname

Can someone please show me how to finish what i need? I need only Distinct Company names in the resultset.

thanks,
rodchar

rodchar
New Member
New Member

--
04 Nov 2008 07:57 PM
thanks for the help,
rod.


Acceptable Use Policy
---