SQL Server 2005 problem with ROW_NUMBER() OVER (ORDER BY ...) -


This question is related to the previous question ... see "View SQL Server 2005 how to set a record when something like operator Using ".

The following tasks ...

 with  as the xx (select the case when mycol = 'finance' then 1 when mycol 'finance'% then 2 when '% Finance%' like McLeek then choose RNK as 3 End * * * from MyTable * * * * * * * *% * like Micix * xx command xx.rnk, by xx.mycol);   

But I really want to do this, because I'm using the page through the record from the server ...

  with xx as (Select case when t.term = 'finance' then 1 when 'finance%' such as t.term then 2 when like t.term '% finance%' then 3 end rnk, *, row_number (more than command rnk By T. TMM) as TLR from TLTR TM where '% Finance%' like TTRM * * * Select from XX *, where between Rathore 11 and 20 - page # 2 xx.rnk , Sequence by xx.mycol;   

I'm getting an error "Invalid column name 'rnk'".

Do anyone have any idea to solve this problem?

Many thanks,

Mark

Problem common table In the expression (CTE) definition you can not reference the rnk in the same SELECT clause, where the column nickname is defined. You can try it: xx with AS (Select the case when t.term = 'Finance' then 1 when 'finance%' such as t.term then 2 when t.term Like '% Finance' as 'Y' ('%' from TLTM, '%' from TFTM, '% Finance%' from TNTM), i.e. AS (Select *, line_number where between 11 and 20 Rambar - Page # 2 by order yy.rnk, yy.mycol;

Comments