I am trying to create View with a left (or right) join for Full-Text Search, and obviously you cannot. I have tried to join using IsNull
, but not working.
How would I create a query, that would go in a view that has a right/left join for FTS?
CREATE TABLE #Tline
(
Id int Primary Key,
[name] varchar(255) null
)
GO
Insert into #Tline (id,name) Values(1,'test 1')
Insert into #Tline (id,name) Values(2,'test 2')
Insert into #Tline (id,name) Values(3,'test 3')
Insert into #Tline (id,name) Values(4,'test 4')
Insert into #Tline (id,name) Values(5,'test 5')
GO
CREATE TABLE #Task (Id int Primary Key, TlineId int null)
GO
Insert into #Task (id,TlineId) Values(1,2)
Insert into #Task (id,TlineId) Values(2,3)
Insert into #Task (id,TlineId) Values(3,4)
GO
SELECT
#Tline.Id, #Task.Id
FROM
#Tline
JOIN #Task ON #Tline.Id = ISNULL(#Task.TlineId,0)
GO
DROP
TABLe #Tline
DROP
TABLe #Task
GO