Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What to do when a subquery returns more than 1 row?

Asked by Anu Rhea Mar 16, 2023 1.3K views 1 answer
Share

About this question

SELECT * FROM wp_posts WHERE ID IN 

(
(SELECT courses  FROM wp_category WHERE CatID =401) OR 
(SELECT  meta_value FROM wp_postmeta WHERE  post_id IN (SELECT courses FROM wp_category WHERE CatID =401) AND meta_key ='post_id' )
) 

AND 

ID IN (SELECT post_id FROM wp_locations_courses WHERE location_id = 1120)

I am having the problem with above query while i am using IN with sub queries gave me the error Subquery returns more than 1 row why it happens when i am using IN clause


Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.