SAMPLE 2 For 9473718

0

Please login or register to vote for this query.

(click on this box to dismiss)

Signal Processing Meta

Q&A about the site for practitioners of the art and science of signal, image and video processing

WITH A As (
SELECT 1 as ID, 100 rank , 'Name1' as Name
UNION SELECT 1,    45,  'Name2'
UNION SELECT 2,    60,  'Name3'
UNION SELECT 2,    42,  'Name4'
UNION SELECT 2,    88,  'Name5' )
, B AS (
SELECT 1 as ID, 'fn1' as FileName
UNION SELECT 2  , 'fn2')
, CTE AS 
(
   SELECT ID, 
          RANK,
          Name,
          DENSE_RANK() OVER (ORDER BY RANK DESC) rn
   FROM A
)
SELECT b.Id , b.FileName,cte.Name
FROM
   b
   INNER JOIN cte 
   ON b.id = cte.id
      and cte.rn =1

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results