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

  • Home
  • SEARCH
  • 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 3937220
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:02:37+00:00 2026-05-20T00:02:37+00:00

My current query: SELECT Series.*, Episodes.* FROM Series, Episodes WHERE EpisodeAirDate > ‘.time().’ AND

  • 0

My current query:

SELECT Series.*, Episodes.* FROM Series, Episodes
WHERE EpisodeAirDate > '.time().' AND Episodes.SeriesKey = Series.SerieID
GROUP BY Series.SerieTitle ORDER BY Episodes.EpisodeAirDate;

I want to retrieve the information from Episodes where Episodes.EpisodeAirDate is the closest to the current time (time()). With this I just get the last episode in the database.

I’ve tried with

SELECT Series.*, Episodes.*, MIN(Episodes.EpisodeAirDate) AS EpisodeAirDate FROM Series, Episodes
WHERE EpisodeAirDate > '.time().' AND Episodes.SeriesKey = Series.SerieID
GROUP BY Series.SerieTitle ORDER BY EpisodeAirDate;

which kind of works, but Episode.EpisodeTitle etc. does not correspond with the timestamp row.

Here I’m using the MIN()-query (http://grab.by/8UNY). I wasn’t allowed to post an image, so perhaps a link will suffice 🙂

As you can see, the SerieTitle and “Time until” is correct, but the EpisodeTitle, EpNo and SeasonNo is that of the first query.

It’s hard to explain, really. I hope you make sense of this! 🙂

  • 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-05-20T00:02:37+00:00Added an answer on May 20, 2026 at 12:02 am

    Please try this:

    SELECT S.*,E.* FROM Series S
    JOIN (SELECT SeriesKey, MIN(EpisodeAirDate) MinDate FROM Episodes
        WHERE EpisodeAirDate > NOW() GROUP BY SeriesKey) M
        ON M.SeriesKey = S.SerieID
    JOIN Episodes E ON E.SeriesKey = S.SerieID AND E.EpisodeAirDate = M.MinDate
    ORDER BY E.EpisodeAirDate;
    

    Edit: Added the ORDER BY clause.

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

Sidebar

Related Questions

My current query: SELECT * FROM `reported_users` GROUP BY `reported_user` ORDER BY ??? I
with my current query and loop: $sched = mysql_query(SELECT * FROM `shows` ORDER BY
My current query reads: SELECT entry_id, user_id, cat_id, AVG( rating ) as avg_rate FROM
My current query: SELECT DACTIONMILLIS, DACTIONDATE INTO WF_DACTIONMILLIS, WF_DACTIONDATE FROM WORKFLOWHISTORY WHERE ddocname=? and
This is my current query: SELECT DISTINCT t.* FROM filter AS f INNER JOIN
I've got the following query: SELECT name, GROUP_CONCAT(job SEPARATOR ','), count(*) FROM users GROUP
Current query SELECT * FROM employee AS E INNER JOIN credential AS C ON
Here is my current query: SELECT sac.cred, s.status, (SELECT NVL (csl.census_dates, tl.census_dates) FROM schema.sections
Current query : SELECT order_id AS OrderNumber, ordName, ordLastName, question, answer FROM cart_survey JOIN
Current Query: SELECT DISTINCT HSP.HSP_ACCOUNT_ID, HSP.HSP_ACCOUNT_NAME, HSP.ADM_DATE_TIME, HSP.DISCH_DATE_TIME, HSP.TOT_CHGS, HSP_ACCT_MULT_DRGS.DRG_ID_TYPE_ID, HSP_ACCT_MULT_DRGS.DRG_MPI_CODE FROM C.HSP HSP

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.