Sandeep Kumar

Sandeep Kumar

  • 1.1k
  • 683
  • 60.4k

how to implement like search

Feb 11 2023 9:44 AM

Declare @FacultyName Nvarchar(100)='Soumoyajyoti'
 SELECT C.ContentTypeId,C.Id,V.VersionId,V.VersionName,C.CourseName,C.DeptName,V.ContentId,V.VersionNote
FROM  [dbo].[ContentDetails] C inner join [dbo].[VersionDetails] V on C.Id=V.ContentId  where V.VersionId in (
select Max(V.VersionId)
  FROM [dbo].[ContentDetails] C inner join [dbo].[VersionDetails] V on C.Id=V.ContentId  where c.FacultyName LIKE ISNULL(@FacultyName, '') + '%'
group by V.ContentId 

) order by  V.VersionId desc


Answers (1)