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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 returns too many rows

Author  Topic 

robmays
Starting Member

3 Posts

Posted - 2005-04-19 : 06:51:04
the query below gives me new row for every payer name. so if a job has 3 payers then i get 3 records returned, i only want to see one record returned with the payernames on the same row.

SELECT Customers.Title, Customers.LastName, SaleItems.TypeOfJob, PhasePayers.PayerName
FROM SaleItems INNER JOIN
Sales ON SaleItems.SaleID = Sales.SaleID INNER JOIN
Customers ON Sales.CustomerID = Customers.CustomerID INNER JOIN
PhasePayers ON SaleItems.PhaseID = PhasePayers.PhaseID
Where SaleitemsID = 1234

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-04-19 : 07:18:12
sample input data, sample expected results would help....
however....search here for "coalesce, csv"....or "row, column, transform" and you should get similar links.
Go to Top of Page

satishdg
Starting Member

10 Posts

Posted - 2005-04-21 : 06:18:53
After FROM Clause you only mentioned Saleitems table.Mention all three table names and try out.

Satish
Go to Top of Page
   

- Advertisement -