Hi
The Int=1 ,N varchar=2,3
After concate this two the result is 1,2,3
How can i use the concate result in where condition.....?
This is my concate function
( SELECT CONCAT(Cities.FK_PrimaryLanguage_ID,',',Cities.FK_SecondaryLanguages_ID)
FROM Cities WHERE ID= 1)
the Results is 1,2,3
This is my stored procedure
ALTER proc [dbo].[Sp_GetMoviesWith_ReviewList]
(
@city int
)
as
begin
select m.ID AS id ,m.ReleaseDate AS rdate ,m.MovieName AS title
,dbo.Movierating(m.ID) as rating
,L.Language AS LANGUAGE
,m.status AS isactive
,m.MobileThumbnailImage AS thumbnail
,( SELECT CASE WHEN COUNT(Trailers.ID)>0 THEN 'true' ELSE 'false' END FROM Trailers WHERE Trailers.FK_Movies_ID = m.ID) AS hastrailers
,( SELECT CASE WHEN COUNT(Reviews.FK_Movie_ID)>0 THEN 'true' ELSE 'false' END FROM Reviews WHERE Reviews.FK_Movie_ID = m.ID) AS hasreviews
,m.Description AS description
,m.cast AS casting
FROM Movies as m
INNER JOIN Languages L ON m.FK_Languages_ID = L.ID
INNER JOIN Theatres ON Theatres.ID = m.ID
WHERE m.status = 1 AND
m.FK_Languages_ID IN
( SELECT CONCAT(Cities.FK_PrimaryLanguage_ID,',',Cities.FK_SecondaryLanguages_ID)
Out put:
Conversion failed when converting the nvarchar value '2,3' to data type int.