Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing ineer query

 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
i have a doubt in writing ineer query .This is my query where all the fileds are in the same table named category and this works fine if i manually give the values in () where select PCategory_Id from catgory is written.can any one help me out fast in resolving this???

SELECT Category_Id,Category_Name
FROM category where Category_Id not in (Select Distinct PCategory_Id from category)
 
Joe Ess
Bartender
Posts: 9302
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sreenath reddy:
Hello
i have a doubt in writing ineer query .This is my query where all the fileds are in the same table named category and this works fine if i manually give the values in () where select PCategory_Id from catgory is written.can any one help me out fast in resolving this???

SELECT Category_Id,Category_Name
FROM category where Category_Id not in (Select Distinct PCategory_Id from category)

Stupid question: Are PCategory_Id and Category_Id different fields or do you have a typo in this query?
Not so stupid question: What database are you using?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic