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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:58:50+00:00 2026-06-14T15:58:50+00:00

SELECT table1.*,table2.*, table3.* FROM table1, table2, table3 inner join ( select table1.id AS pid,

  • 0
SELECT table1.*,table2.*, table3.*
FROM table1, table2, table3
inner join 
 (
   select table1.id AS pid, max(table1.createtime) AS timestamp
   from table1 group by table1.id
 ) A on A.pid = table1.id AND A.timestamp = table1.createtime
WHERE table3.id = table1.id
ORDER BY table1.createtime;

I am trying to fetch only the last modified record for each id in table1.

For the above query I am getting error as:

"%s:invalid identifier" for  "A.timestamp = table1.IDA2A2" this part.

Please let me know what is wrong with this query.
DB is Oracle.

  • 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-14T15:58:51+00:00Added an answer on June 14, 2026 at 3:58 pm

    Well part of your problem is you are mixing JOIN syntax – your query is using both comma joins and ANSI JOIN syntax. You need to properly join the tables:

    SELECT t1.,t2., t3.* 
    FROM table1 t1
    INNER JOIN table2 t2
      on t1.id = t2.id
    INNER JOIN table3 t3
      on t1.id = t3.id
    inner join 
    (
      select table1.id AS pid, max(table1.createtime) AS timestamp 
      from table1 
      group by table1.id
    ) A 
      on A.pid = t1.id 
      AND A.timestamp = t1.createtime 
    ORDER BY t1.createtime;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my query select * from table1 inner join table2 on table1.typeId=table2.typeId; This
Given a query like: SELECT table1.field1 FirstField, table2.field2 SecondField FROM table1 INNER JOIN table2
I have the following MySQL query statement: SELECT * FROM table1 INNER JOIN table2
Given these two queries: Select t1.id, t2.companyName from table1 t1 INNER JOIN table2 t2
I'm trying to execute the following SQL: SELECT * FROM Table2 INNER JOIN (SELECT
Whats the difference between SELECT DISTINCT field1 FROM table1 cd JOIN table2 ON cd.Company
const char *sqlStatement = select s.id, s.no, s.sc p.na from table1 s inner join
SELECT * FROM TableA INNER JOIN TableB ON TableA.name = TableB.name SELECT * FROM
First option: SELECT Table1.* ,Table2.Price AS Price FROM Table1,Table2 WHERE Table1.ID = Table2.ID Second
The following query: select unnest(Table2.L) as X, unnest(Table1.O) from Table1, Table2 where Table1.code =

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.