Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8376021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:19:30+00:00 2026-06-09T15:19:30+00:00

does anyone knows what’s going on with this query please ?. What I am

  • 0

does anyone knows what’s going on with this query please ?. What I am trying to do is if courseID in elective_modules table doesn’t exist in group_elective_modules table, then print all exit in group_elective_modules. But I keep getting the error Operand should contain 1 column(s)

Here is my query

$alternativeEQuery = 
"SELECT elective_modules.courseID,elective_modules.yr 
 FROM elective_modules
 WHERE elective_modules.yr = '$year1' 
 AND elective_modules.courseID 
 NOT IN 
     (SELECT group_elective_modules.moduleID,group_elective_modules.courseName 
 FROM group_elective_modules 
 WHERE group_elective_modules.courseName = '$courseTitle'
 AND elective_modules.courseID = group_elective_modules.moduleID)";

$alternativeEResult = mysql_query($alternativeEQuery) or die($alternativeEQuery."<br/><br/>".mysql_error());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:19:31+00:00Added an answer on June 9, 2026 at 3:19 pm

    You can’t have two columns in the subquery here:

    (SELECT group_elective_modules.moduleID,group_elective_modules.courseName 
     FROM group_elective_modules 
     WHERE group_elective_modules.courseName = '$courseTitle'
     AND elective_modules.courseID = group_elective_modules.moduleID)
    

    Either use the right one, or add in a second not in clause and use the other column name there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

does anyone knows why doesn't the onload event binds the this variable as expected?
Does anyone knows the way to tell which files are going to be deleted
does anyone knows how to indicate when Column property width is changed on this
Does anyone knows how can i make an effect like this in my search
Does anyone knows how to query a full text catalog population to see its
Does anyone knows of a text generator like this one , written in .Net
Does anyone knows how to do this? using the java sockets
Does anyone knows how to get table name from model name? Also I want
Does anyone knows how data is beeing retrived from table storage? var result =
Does anyone knows the best way to make a caption like this one https://i.stack.imgur.com/CA2NH.png

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.