Declare @FacultyName Nvarchar(100)
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 @FacultyName
group by V.ContentId
) order by V.VersionId desc
Naimish MakwanaPosted Feb 11, 2023, 8:55 AM
Try with below.
Jignesh KumarPosted Feb 12, 2023, 5:33 AM
Hello sandeep,
Please use below query,
Naimish MakwanaPosted Feb 11, 2023, 10:08 AM
Use below query as you want.
Thanks
Sandeep KumarPosted Feb 11, 2023, 9:43 AM
I want like search like this
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
Sandeep KumarPosted Feb 11, 2023, 8:34 AM
Please go through my sql query
my query returns two but in linq returning only one raw
Naimish MakwanaPosted Feb 11, 2023, 7:20 AM
Hello Sandeep,
Try below.
Thanks
Naimish Makwana