How to select the Last row from a table..using Mysql

Reply

Join Date: Jul 2006
Posts: 2
Reputation: mishu007 is an unknown quantity at this point 
Solved Threads: 0
mishu007 mishu007 is offline Offline
Newbie Poster

How to select the Last row from a table..using Mysql

 
0
  #1
Jul 26th, 2006
Suppose this is a Table

Create Table Person(
PersonID varchar(8),
PersonLN varchar(16),
PersonFN varchar(16),
PersonADD varchar(64),
PersonPH varchar(16));

so there are many enrty in that table.. So how to select the lastest row entry from that table? what will be the Mysql statement?

take PersonID as a Primary key..........
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: How to select the Last row from a table..using Mysql

 
1
  #2
Jul 26th, 2006
  1. SELECT *
  2. FROM Person
  3. ORDER BY PersonID DESC
  4. LIMIT 1
Last edited by stymiee; Jul 26th, 2006 at 10:10 am.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 5
Reputation: hazel_0821 is an unknown quantity at this point 
Solved Threads: 0
hazel_0821 hazel_0821 is offline Offline
Newbie Poster

Re: How to select the Last row from a table..using Mysql

 
0
  #3
Nov 28th, 2006
Originally Posted by mishu007 View Post
Suppose this is a Table

Create Table Person(
PersonID varchar(8),
PersonLN varchar(16),
PersonFN varchar(16),
PersonADD varchar(64),
PersonPH varchar(16));

so there are many enrty in that table.. So how to select the lastest row entry from that table? what will be the Mysql statement?

take PersonID as a Primary key..........
do you have the values?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 440
Reputation: Sulley's Boo will become famous soon enough Sulley's Boo will become famous soon enough 
Solved Threads: 10
Sulley's Boo's Avatar
Sulley's Boo Sulley's Boo is offline Offline
Posting Pro in Training

Re: How to select the Last row from a table..using Mysql

 
0
  #4
Nov 29th, 2006
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 2
Reputation: avinashzala is an unknown quantity at this point 
Solved Threads: 0
avinashzala's Avatar
avinashzala avinashzala is offline Offline
Newbie Poster
 
-2
  #5
Nov 7th, 2009
Just check out this for getting last updated row
<URL SNIPPED>
Last edited by peter_budo; Nov 8th, 2009 at 3:39 am. Reason: Keep It On The Site - Posts must contain actual content and substance and cannot simply be external links.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 54970 | Replies: 4
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC