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
 General SQL Server Forums
 New to SQL Server Programming
 join problem

Author  Topic 

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2007-03-01 : 03:24:34
hi this is my spc:

select top 1 u.userid,
u.user_name,
u.password,
c.code_description as role_code,
u.expiry_date,
u.created_date,
u.active,
convert(varchar,v. user_date, 103) + ' ' + right('0' + stuff(right(convert(varchar,v.user_date, 109), 14), 8, 4, ''), 10) as user_date,
v.operation,v.userid
from [usermaster] u inner join [codeMaster] c
on 'AD'=c.code inner join [HRUser_developerlog] v on u.userid=v.inserted_id and v.operation='update'
where u.userid = '1' order by v. user_date desc

this works fine.

my need id here v, instead of v.userid i want to show the username.i heve one more table called names which has two columns(name,userid).
so i want ot take name from names tables using that v.userid.


so please help me to get my need please

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-01 : 03:31:35
So? What's the problem?

Join names table with HRUser_developerlog table on userid.


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2007-03-01 : 04:04:44
hi harsh depends upon the v.useris i have to take the name from namemaster can uplease modify my procedure using ur syntax please
Go to Top of Page

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2007-03-01 : 04:59:46
please any one reply for me please
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-01 : 05:43:01
quote:
Originally posted by sqllover

hi harsh [b]depends[/b[ upon the v.useris i have to take the name from namemaster can uplease modify my procedure using ur syntax please


what is the condition ? When to take and when not to take ?


KH

Go to Top of Page

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2007-03-01 : 06:12:51
hi khtan i have done that thanks for ur reply
Go to Top of Page
   

- Advertisement -