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)
 Select Query Error

Author  Topic 

vraya
Starting Member

5 Posts

Posted - 2008-08-18 : 05:51:26
When is run this Query

Select PhotoName,photoName1,photoName2,photoName3 from BusinessProfilePhoto where BusinessProfileID in (Select CategoryName,SubCategoryName from CreateAdCategory where BusinessProfileID in(Select BusinessProfileID from BusinessProfile where CountryID=7 and StateProvinceID=53))

I Get Error message

Msg 116, Level 16, State 1, Line 1
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

what is problem is any alternate for this query



Vijayaraya

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-18 : 06:04:39
may be this

Select bpp.PhotoName,bpp.photoName1,bpp.photoName2,bpp.photoName3 from BusinessProfilePhoto bpp
join CreateAdCategory cad
on bpp.BusinessProfileID=cad.BusinessProfileID
join BusinessProfile bp
on bp.BusinessProfileID=cad.BusinessProfileID
and bp.CountryID=7
and bp.StateProvinceID=53

Go to Top of Page
   

- Advertisement -