problem with select within select

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 33
Reputation: ansari.wajid is an unknown quantity at this point 
Solved Threads: 0
ansari.wajid ansari.wajid is offline Offline
Light Poster

problem with select within select

 
0
  #1
Sep 24th, 2008
Hi

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

  1. SELECT * FROM ( SELECT vRefTable FROM mainmenu WHERE iMenuId=58 )
  2. WHERE (SELECT vFieldsName FROM TableField WHERE iMenuId=58
  3. 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
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: problem with select within select

 
0
  #2
Sep 24th, 2008
you need to specify what column for the where and the =1 i have no clue what you are wanting there

  1.  
  2. SELECT * FROM ( SELECT vRefTable FROM mainmenu WHERE iMenuId=58 )
  3. WHERE
  4. -- your column name here
  5. vFieldsName IN
  6. (SELECT vFieldsName FROM TableField WHERE iMenuId=58
  7. AND bIsPrimary=1 AND iTableFieldId=11)
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC