This is my table data.
I need to select that views as a new column.(if available only) this is the result i need
I tried this way. but not getting correct results
SELECT dbo.tables.DocNo, dbo.tables.Types, tables_1.Types AS viewstatus
FROM dbo.tables INNER JOIN
dbo.tables AS tables_1 ON dbo.tables.DocNo = tables_1.DocNo
WHERE (dbo.tables.Types = N'Original')
GROUP BY dbo.tables.DocNo, dbo.tables.Types, tables_1.Types
HAVING (tables_1.Types = N'Views')
>Solution :
A solution with ´group by` without a join:
select min(id),
min(case when Types = 'Original' then Types end),
DocNo,
max(Name),
min(case when Types = 'Views' then Types end)
from table_name
group by DocNo;

