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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:21:19+00:00 2026-06-17T19:21:19+00:00

well FYI this is my first post, so i don’t really know about the

  • 0

well FYI this is my first post, so i don’t really know about the rule here,

i just stuck in selecting data from my db, here’s some of my data.

Table (Monster_card)
mons_card_id | Level
    1           1
    2           1
    3           1
    4           1
Table (Monster_registration)
mons_reg_id |mons_card_id | status      | time(timestamp)
    1            1         "REGISTER"    "2012-07-09 12:00:00"
    2            1         "UNREGISTER"  "2012-11-01 12:49:01"
    3            2         "REGISTER"    "2012-11-03 12:49:01"
    4            3         "REGISTER"    "2012-11-04 12:49:01"

my current query is =

select a.mons_card_id from monster_card a, monster_registration b
where b.status = "REGISTER"

;

my desired result = by the data above, the result should only mons_card_id 2 & 3.
but in my current result, mons_card 1 also shown up.

sorry for the incomplete post before.

any suggestion?

  • 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-17T19:21:20+00:00Added an answer on June 17, 2026 at 7:21 pm

    You can use NOT EXISTS to make sure there are no more recent records with a status other than “REGISTER” for a given mons_card_id

    SELECT mons_card_id
    FROM monster_registration M
    WHERE M.status = 'REGISTER' AND NOT EXISTS (
        SELECT 1 FROM monster_registration R
        WHERE R.mons_card_id = M.mons_card_id
            AND R.time > M.time 
            AND R.status <> 'REGISTER'
    )
    

    Working SqlFiddle

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

Sidebar

Related Questions

This is my first post. I'm the lead programmer on a FIRST robotics team,
First things first.. My apologies if this is a duplicate post.. Correct me, redirect
First post, but I've been lurking around this site for a long while now,
well i have a configuration like this in the components part of my config
Well, I was trying to fix this program, and I keep getting the errors
[FYI: I've got the answer, and I'm in process of writing the solution. This
(FYI, the bug occurs on the official demos as well as my own demos
Hope you're well! I'm still working on this to-do list site and I'm a
So I know that there is a very similar question to this all over
This must have been already done, and I am missing something about how Angular

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.