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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:08:10+00:00 2026-06-08T18:08:10+00:00

I have two table (below codes) , want to retrieve last row of trackers_data

  • 0

I have two table (below codes) , want to retrieve last row of trackers_data table and GROUP BY tracker_id and (join) information of each tracker_id from Table Devices

Devices/Table:

        /*Table: devices*/
id  tracker_id  name        device_name
-----------------------------------
1   1242        Driver A    Benz
2   1255        Driver B    Volvo
3   1256        Driver C    BMW

Trackers_data/Table:

     /*Table: trackers_data*/
id  tracker_id  longitude   latitude
-------------------------------------
5       1255    53.25       11.52
6       1255    52.63       11.63
7       1242    52.23       13.11
8       1242    52.25       15.27
9       1242    54.63       13.86

Example/Results should like below :

     /* Results */
id  tracker_id  lonitude    latitude    name        device_name
6   1255        52.63       11.63       Driver B    Volvo
9   1242        54.63       13.86       Driver C    BMW
  • 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-08T18:08:10+00:00Added an answer on June 8, 2026 at 6:08 pm

    You can use this solution:

    SELECT b.*, c.name, c.device_name
    FROM   (SELECT MAX(id) AS id FROM trackers_data GROUP BY tracker_id) a
    JOIN   trackers_data b ON a.id = b.id
    JOIN   devices c ON b.tracker_id = c.tracker_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with like below codes: Table: Accounts id | username |
I have two table masterTbl and detailTbl which structure is given below... --PRIMARY TABLE
I have created two tables & inserted values as shown below . Table 1
Hi i have a table as below with two column, 1.CODE, 2.Description Code Description
I have two tables described below. What I need is a single query that
I'm using SQL Server 2008. Let's say I have two hypothetical tables like below:
I have two tables like the ones below. I need to find what exchangeRate
I have two tables names book_list and book_category . Schema is like below: book_list
I have two tables A and B as defined bellow. create table A (
I have 10 tables in my database(MySQL). two of them is given below tbl_state

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.