MySQL Forums
Forum List  »  Newbie

"SELECT IN SELECT" problem in MySQL
Posted by: Creative ChinaPCG
Date: September 19, 2014 08:36AM

1) the result of sql statment "SELECT rsa_lookup_id FROM `rsa_policy_plan_lookup` WHERE rsa_plan_id=1" is "11,12,16"

2) Runing in MySQL properly if the sql statment "SELECT rsa_eventNature_id, rsa_eventNature_name FROM rsa_eventnature WHERE rsa_eventNature_id IN (11,12,16)

However, if I try to combine 1 & 2 into the sql statment "SELECT rsa_eventNature_id, rsa_eventNature_name FROM rsa_eventnature WHERE rsa_eventNature_id IN (SELECT rsa_lookup_id FROM `rsa_policy_plan_lookup` WHERE rsa_plan_id=1) "

the result is not the same #2. Why??? How to solve?

Much thanks.

Options: ReplyQuote


Subject
Written By
Posted
"SELECT IN SELECT" problem in MySQL
September 19, 2014 08:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.