Hi there.I am trying to call a table-valued function (dbo.fn_SelectAlignedSequences) from another scalar-valued function (fn_SeqAvgSimilarityUnderNode2). Here is the queryCreate Function [dbo].[fn_SeqAvgSimilarityUnderNode] (@AlnID int, @ParentTaxID int, @SeqTypeID int, @LocationID int) RETURNS FLOATASBEGIN Declare @AvgSim float ;With Seqs (SeqID) as (-- All aligned sequences under the node select dbo.fn_SelectAlignedSequences(@AlnID, @ParentTaxID, @SeqTypeID, @LocationID) ) Select @AvgSim = AVG(Similarity) From ( Select s1.SeqID ,s2.SeqID ,dbo.fn_pairwiseSimilarity(@AlnID, s1.SeqID, s2.SeqID) as 'Similarity' From Seqs s1 cross join Seqs s2 Where s1.SeqID < s2.SeqID ) t return @AvgSimEND
The query does not work.Error message"Cannot find either column "dbo" or the user-defined function or aggregate "dbo.fn_SelectAlignedSequences", or the name is ambiguous.Is there anything I did wrong?Thanks