Hi

I want to execute below query in ms-sql server 2000 but its giving errors.
Can anybody help please.

select * from ( select vRefTable from mainmenu where iMenuId=58 )
where (select vFieldsName from TableField where iMenuId=58
and bIsPrimary=1 and iTableFieldId=11) = 1

Its showing below errors. your help is greatly appreciated.

Server: Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'where'.
Server: Msg 170, Level 15, State 1, Line 3
Line 3: Incorrect syntax near '='.

Thanks
Ansari

you need to specify what column for the where and the =1 i have no clue what you are wanting there

select * from ( select vRefTable from mainmenu where iMenuId=58 )
where 
-- your column name here
 vFieldsName  in 
(select vFieldsName from TableField where iMenuId=58
and bIsPrimary=1 and iTableFieldId=11)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.