Riddhi Valecha

Riddhi Valecha

  • 444
  • 3.3k
  • 412.8k

SQL Query - Row_Number - Invalid Column Name

May 6 2015 6:52 AM
Hi..

select * from
(select ROW_NUMBER() over (order by MyTable.VName) as ROW,  
MyTable.RCMS_ID as
'V ID', MyTable.VName as 'V Name', (SELECT TableUser.FName +'    '+
TableUser.LName FROM TableUser where TableUser.Flag = 1 and
TableUser.EmpCode=convert(numeric(25,0),   MyTable.CreatedBy)) as 'Created By' ,
CONVERT(VARCHAR(10),MyTable.CreatedOn ,103)    AS 'Created On' 
from MyTable where
MyTable.Flag=1) t1 where t1.V ID = '101'

--------

I am getting error as - Invalid Column Name.

How to get column name in where clause with space

Answers (4)