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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:00:05+00:00 2026-05-20T19:00:05+00:00

I have two mysql tables that have the following structure: Table 1: —ID———NAME——- —1—–

  • 0

I have two mysql tables that have the following structure:

Table 1:

---ID---------NAME-------
---1----- page name 1 ---
---2----- page name 2 ---
---3----- page name 3 ---

Table 2:

----ID---PAGE ID---------NAME------
-----1-----1-------- page name 1 ---
-----2-----2-------- page name 2 ---
-----3-----3-------- page name 3 ---
-----4-----1-------- page name 1 ---
-----5-----2-------- page name 2 ---
-----6-----3-------- page name 3 ---
-----7-----1-------- page name 1 ---
-----8-----2-------- page name 2 ---
-----9-----3-------- page name 3 ---

As you can see in table 2 each page is mentioned several times.

I want to join Table 1 on Table 2 only with the newest records in Table 2, in this case the newest three records only! (“newest” means records with higher IDs) Is that possible using mysql?

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

    Table2

    ----ID---PAGE ID----
    -----1-----1-------- 
    -----2-----2-------- 
    -----3-----3-------- 
    -----4-----1-------- 
    -----5-----2-------- 
    -----6-----3-------- 
    -----7-----1-------- 
    -----8-----2-------- 
    -----9-----3-------- 
    

    and

    SELECT Table1.ID, PAGE_ID, NAME
    FROM Table1
    LEFT JOIN Table2 ON Table1.ID = Table2.PAGE_ID
    WHERE ... put your condition for latest if other when highest ID
    ORDER BY Table1.ID DESC
    LIMIT 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two MySQL tables with a similar structure. i.e. Table_A - Col1, Col2,
I have a MySQL database with the following table structure: TransactionType : Transaction_Amount, Transaction_ID,
Say I have an MSSQL table with two columns: an int ID column that's
I have two mysql tables, one containing details on cars and one containing all
When I have two mysql servers that have different jobs (holding different databases) but
I have two applications written in Java that communicate with each other using XML
I have two identical tables and need to copy rows from table to another.
I have two tables, Table A with 700,000 entries and Table B with 600,000
In a MySQL database I have a table with the following primary key PRIMARY
i have two mysql tables tableA col1 col2 SIM1 ..........col24 ----------------------------------- a x 1

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.