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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:58:59+00:00 2026-05-25T23:58:59+00:00

I have for example these 2 tables: Organiser Events ———- ——- id 1 id

  • 0

I have for example these 2 tables:

Organiser        Events 
----------       -------
id         1     id
           |__ * organiser_id
                 date
                 status

How do I select the ids of all organisers who’s latest event it’s status equals for example ‘active’.

I think I have to use max(date) in maybe a subquery or do I need to use a join? Still haven’t found the solution, so any help is appreciated!

Thanks

EDIT:

I just found this solution (dunno if this is the best one?):

SELECT o.id, e.date
FROM Organiser o
INNER JOIN events e on e.organiser_id = o.id
WHERE e.date = (SELECT max(date) 
                FROM events e2
                WHERE e2.organiser_id = o.id) 
  • 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-25T23:58:59+00:00Added an answer on May 25, 2026 at 11:58 pm
    SELECT
          id
    FROM 
          Organiser AS o
    WHERE 
          ( SELECT status
            FROM Events AS e
            WHERE e.organiser_id = o.id
            ORDER BY `date` DESC
            LIMT 1
          ) = 'active'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
So I have these tables: STUDENTS: Student ID - First name - Last name
Assume I have these tables, from which i need to display search results in
I have several tables with the same structure. How can I select SUM(field) from
Does anyone have any suggestions for creating meta tables in a database? These tables
I have a schema with many related tables. A view let me agglomerate all
I have these tables: class Contract(models.Model): project = models.ForeignKey(Project) start_date = models.DateField() agreed_contacts =
I have three tables as a SQLITE3 Dump. products,tax,inventory From these tables preparing a
I have created several private tables in Fusion Table. These tables should be accessed
I have these tables: CREATE TABLE User( Username varchar(15) NOT NULL, Name varchar(20) DEFAULT

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.