| | |
How to select the Last row from a table..using Mysql
![]() |
•
•
Join Date: Jul 2006
Posts: 2
Reputation:
Solved Threads: 0
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..........
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..........
MySQL Syntax (Toggle Plain Text)
SELECT * FROM Person ORDER BY PersonID DESC 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!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: Nov 2006
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
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..........
![]() |
Similar Threads
- can i select the 2nd row/record from a table (MySQL)
- Apache (Linux Servers and Apache)
- How to change the color of selected row of an HTML table without using CSS or Javascr (VB.NET)
- php table help (PHP)
- mysql errors, from submit.php and index.php (PHP)
- How can I create database/table images in MySQL (PHP)
- Print 5 records per table row (see script) (Perl)
- Find and Replace (Database Design)
Other Threads in the MySQL Forum
- Previous Thread: .sql file loses characters
- Next Thread: creating files with 'outfile'??
Views: 54970 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for MySQL
"use" .db 1 ajax alphabet amazon aws camparingtocolumns cascade cast code convert count count(col) data database delete design distinct ec2 eliminate enter error form generator html images innerjoins insert join keyword keywords matchingcolumns multiple multipletables mysql mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch noob number open operand oracle order parse pdf php print query recursive relationaldatabases relationship relationships remove reorderingcolumns resultset retrieve script search select simpledb sort sql statement string syntax table tree type-conversion update values welsh






