• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get last inserted row in MySql through JSP

 
Chintan Shah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to get the last inserted row in MySql..but not able to fetch it.
this is what i used
i have one column order_id which is auto_increment
SELECT * FROM tablename WHERE order_id=(SELECT MAX(order_id) FROM tablename)
any help is appreciated .
the usage of lastinsert() method is also not successful
chintan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic