Reputation: 3494
Is this possible to use function in Join. Why i want this Because my function return value from table where the data in comma separated
Example - '20122200',20122',
Return from function
20122200
20122
select FileNamePath,ex.ExprtINI,PROCESSED from OrderExports OE
INNER JOIN ExporterFiles EX ON EX.RefVal= CAST (OE.ID as varchar)
where
EX.ExportName = 'Ensenda'
in above sql statement i want to use function at EX.RefVal= CAST (OE.ID as varchar)
to EX.RefVal= fngetAllRefValfromExporterFiles()
. i tried to do this but can't do. So can you please help me about this.
Upvotes: 0
Views: 254
Reputation: 93694
Since it is a table valued function
you cannot use it like that.
Use the TVF
result in IN
clause
EX.RefVal in (select fun_col from fngetAllRefValfromExporterFiles())
or you can join the function with your table
yourtable EX
JOIN Fngetallrefvalfromexporterfiles() b
ON EX.RefVal = b.fun_col
Upvotes: 1