CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1

    Exclamation Database Error 1242 while filtering data record

    I am getting the following error while trying to filter record in Database.

    Fatal error: Database error 1242: Subquery returns more than 1 row
    Invalid SQL: SELECT EP.es_preadmissionid, EP.pre_name, (SELECT roll_no FROM es_sections_student ESS WHERE ESS.student_id=EP.es_preadmissionid ) AS ROLL_NO, (SELECT section_id FROM es_sections_student ESS WHERE ESS.student_id=EP.es_preadmissionid) AS SECTION FROM es_preadmission EP , es_preadmission_details EPD where EP.pre_status !='inactive' AND EPD.es_preadmissionid=EP.es_preadmissionid AND EPD.pre_class=1 ORDER BY es_preadmissionid ASC in /home/content/16/9882416/html/products.projectdesk.info/s-erp/office_admin/includes/classes/developer.mysql.class.php*on line 136

    Can anybody help me out in solving above error that why is it occuring????
    Live Project Training

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Database Error 1242 while filtering data record

    It means IMHO that at least on of these SQL expressions:
    Code:
    (SELECT roll_no FROM es_sections_student ESS WHERE ESS.student_id=EP.es_preadmissionid ) AS ROLL_NO
    (SELECT section_id FROM es_sections_student ESS WHERE ESS.student_id=EP.es_preadmissionid) AS SECTION
    may return more than one records while either of expressions must return either one record or nothing.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured