title: Error: subquery Returns more than one row
body: <p>Hi I have been trying to select more than one rows by calling the procedure through CallableStatement. While I am trying to populate the result set to the combo box the code returns the error as follows.</p>
  
  <p>Java Error:</p>
  
  <pre><code>                   java.sql.SQLException: Subquery returns more than 1 row
  </code></pre>
  
  <p>Stored Procedure : </p>
  
  <pre><code>CREATE DEFINER=`user_name`@`%` PROCEDURE `GET_USER_PROFILE`(
              IN p_user_id VARCHAR(150),
              IN p_role VARCHAR(150),
              OUT p_user_data VARCHAR(200),
              OUT p_city VARCHAR(150),
              OUT p_state VARCHAR(150),
              OUT p_country VARCHAR(150),
              OUT q_Msg VARCHAR(150))
  BEGIN
  
  DECLARE available INT DEFAULT 0;
   SET p_city = (SELECT CITY FROM countries GROUP BY CITY);
   SET p_state = (SELECT STATE FROM countries GROUP BY STATE);
   SET p_country = (SELECT COUNTRY FROM countries GROUP BY COUNTRY);
  
  SELECT COUNT(EMAIL) INTO available FROM STAFF_PROFILE WHERE EMAIL = p_user_id AND ROLE = p_role;
  
  IF(available=1) THEN
          SET p_user_data = (SELECT * FROM STAFF_PROFILE WHERE EMAIL = p_user_id AND ROLE = p_role );
  else
      SET q_Msg = 'USER_LOGGED_FIRST';
  END IF;
  
  END
  </code></pre>