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 2008 Forums
 Transact-SQL (2008)
 left join

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2013-11-12 : 23:06:50
I have two tables tbldeathdata and guestbook will multiple id , i want to match id and give the record , below is my tried query

SELECT lastname+'-'+ Firstname FROM deathdata a where a.id = (select id from GuestBook)


error


sg 512, Level 16, State 1, Line 2
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.



Desikankannan

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2013-11-12 : 23:12:40
[code]
SELECT a.lastname + '-' + a.Firstname
FROM deathdata a
inner join GuestBook b on a.id = b.id
where a.id = (select id from GuestBook)
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -