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)
 help needed in left outter join query

Author  Topic 

kondurupraveen
Starting Member

6 Posts

Posted - 2005-07-27 : 01:46:51
hi everyone,
i've 2 tables which look like

tbl_submaster
subid---subname
1--------sub1
2--------sub2
3--------sub3

tbl_assignemp
empid---subid
emp1-----1
emp2-----1
emp1-----2

i want my result as

subname---empid
sub1------emp1,emp2
sub2------emp1
sub3------<null>

i've used left outter join but i got result as

subname---empid
sub1------emp1
sub1------emp2
sub2------emp1
sub3------<null>

can someone plz help me out....its urgent plz.....
any kind of response would be appreciated
praveen

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-27 : 01:51:24
Refer this
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx?Pending=true

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

kondurupraveen
Starting Member

6 Posts

Posted - 2005-07-27 : 03:00:31
Thanks Madhivanan your help really helped me out.
thank you very much
but i dont understand that the output variable in userdefined funtion is varchar(8000) and if im tring to reduce it then the output is not correct.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-27 : 03:31:15
>>if im tring to reduce it then the output is not correct.

Thats why you should use maximum length

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -