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 8336559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:01:45+00:00 2026-06-09T04:01:45+00:00

In MySql database have AM_COURSE UserId CourseName course_desc 101 java sometext… 102 mysql sometext….

  • 0

In MySql database have AM_COURSE

UserId      CourseName   course_desc
  101          java        sometext...
  102          mysql       sometext....
   :

AM_TIMETABLE table in that

UserId        Date_Time
 101        2012-08-08 04:00:00 
 102        2012-08-15 10:00:00
 103        2012-08-18 09:00:00
 104        2012-08-24 05:00:00

My Question is, i’m passing start-date and end-date and CourseName then i want to get UserId in that way i wrote query

select UserId,CourseName,course_desc from AM_COURSE where name='java' and UserId=(SELECT UserId FROM AM_TIMETABLE WHERE `Date_Time` BETWEEN '2012-08-07 00:00:00' AND '2012-08-20 00:00:00')

then i will get 101 UserId value.
but i’m getting error because inner query give two id’s… please help

  • 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-09T04:01:48+00:00Added an answer on June 9, 2026 at 4:01 am

    If your inner query is returning more than 1 result (and this is valid of course for your scenario) then shouldn’t you be using the IN clause?

    select UserId
    ,CourseName
    ,course_desc 
    from AM_COURSE 
    where name='java' and UserId in (
        SELECT UserId 
        FROM AM_TIMETABLE 
        WHERE `Date_Time` BETWEEN '2012-08-07 00:00:00' AND '2012-08-20 00:00:00'
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL database that I am keeping temperature readings from several different
I am using Mysql database. I have 3 table-: table Column tier_price customer_id,sku(Unique),price,website catalog_product
I have a datagridview in c# that i am filling from a mysql database.
I have a JavaScript slideshow that pre-loads images out of a MySQL database and
I have entries in a mysql database that have htmlentities, so, e.g., &ouml instead
I am using CakePHP framework with MySQL database and I have problem in saving
I have a mysql database in which i am using auto_increment(integer), can you tell
I am connecting a MYSQL database through hibernate and i seem to have processes
I have multiple tables in a mysql database and I am trying to put
I have taken the backup of mysql database but when I am trying to

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.