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
 SQL Server Development (2000)
 Join Problem?

Author  Topic 

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2008-08-01 : 04:35:44
I want only records from rtb but i'm getting also from Co
Plz help .

CREATE PROCEDURE [dbo].[d_tt]
@rid int
AS
select r.CustomerID as cid,c.Name as cname,s.Name as ---
from rtb r
left join Sr s on r.SID = s.SID
left join Co c on r.CID = c.CID
left join Rc rc on r.rs=rc.rs
where r.SID=@rid
order by r.CustomerID
GO

pootle_flump

1064 Posts

Posted - 2008-08-01 : 04:47:37
Sorry - doesn't make sense - you reference columns from Co in your select statement. What do you mean you don't want records from Co?
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-08-01 : 04:48:33
eh? you're selecting records from Co. if you don't want them don't select them

Em
Go to Top of Page

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2008-08-01 : 04:56:47
I need only name from Co where Co.ID=rtb.ID
What's wrong my query?

quote:
Originally posted by elancaster

eh? you're selecting records from Co. if you don't want them don't select them

Em

Go to Top of Page

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2008-08-01 : 05:03:13
Can anyone suggest me?

quote:
Originally posted by pootle_flump

Sorry - doesn't make sense - you reference columns from Co in your select statement. What do you mean you don't want records from Co?

Go to Top of Page

pootle_flump

1064 Posts

Posted - 2008-08-01 : 06:02:42
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -