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 2005 Forums
 Transact-SQL (2005)
 is this possible

Author  Topic 

Deep123
Starting Member

8 Posts

Posted - 2009-06-15 : 03:32:15

can i write the query this way



select *,(select fullname from users where username='deepan')+ (select fullname from company_admininfo where username='deepan' )as username
from documents d where docname='ComposeMail_Div.txt' and path='~//projects//deepan_5_Test123\TestFolder^6' order by projectrev desc

username returns null

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-15 : 03:47:31
select *,coalesce((select fullname from users where username='deepan'), '')+ coalesce((select fullname from company_admininfo where username='deepan' ), '') as username
from documents d where docname='ComposeMail_Div.txt' and path='~//projects//deepan_5_Test123\TestFolder^6' order by projectrev desc



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-06-15 : 03:48:07
quote:
Originally posted by Deep123


can i write the query this way



select *,(select fullname from users where username='deepan')+ (select fullname from company_admininfo where username='deepan' )as username
from documents d where docname='ComposeMail_Div.txt' and path='~//projects//deepan_5_Test123\TestFolder^6' order by projectrev desc

username returns null


Is there a connection between users and company_admininfo table
you can try this
[code] select a.fullname+b.fullname from users a,comapny_admininfo b
where a.id=c.id

Regards,
Ahmad Osama
Go to Top of Page
   

- Advertisement -