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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:07:53+00:00 2026-06-17T08:07:53+00:00

I have following two tables in the database. One table is person table and

  • 0

I have following two tables in the database. One table is person table and other table is Entry table, entry table records the persons entrance to a department

Person Table

    Person                  
Person_ID   Person_NIC  Person_Name Person_Last_Name    Person_Age  State
1           121212          ABC         BCD              12         ACTIVE
2           212121          ABB         BBB              13         NONACTIVE
3           111111          BBB         CCC              14         ACTIVE

Entry Table

ENTRY           
Entry_ID  Person_ID Entry_Escort    Entry_Date  
1         1           David         20121210    
2         1           David         20130110    
3         1           David         20130111    
4         1           David         20130112    
5         1           David     20130113    
6         2           David     20121210    
7         2           David     20130110    
8         2           David     20130111    
9         2           David     20130112    
10        2           David     20130113    

I have to write sql for following scenario. I need to find Last Entry date for persons how are non active in the database for the month of January. could anybody help me with query. thanks in advance for any 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-17T08:07:54+00:00Added an answer on June 17, 2026 at 8:07 am

    This should be as as easy as this:

    SELECT p.Person_ID, MAX(e.Entry_Date) as MaxEntryDate
    FROM 
     Person p 
     INNER JOIN Entry e
       ON p.Person_NIC = e.EntryID
    WHERE p.State = 'NONACTIVE'
       AND Entry_Date  BETWEEN 20130101 AND 20130131
    GROUP BY p.Person_ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two tables in my mysql database. Table Name: groups id
I have two tables, one table A that is the parent and other table
I have two tables in my database, one is Transactions and the other is
I have two tables in my database. The first one, [nodeActivity] has the following
I have two database tables with the following structure: actions: action_id int(11) primary key
I have a database with two tables, tblPlayers and tblMatches. tblPlayers contains the following
I have the following two tables, affiliates and referrers. affiliates Table id loginid 3
I have two databases: one contains the users: persons id name course the other
Let's say I have the following scenario. A database of LocalLibrary with two tables
I have the following two tables in my database (the indexing is not complete

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.