PDA

View Full Version : get the latest entry



homer.favenir
12-09-2008, 06:08 AM
hi,
can anyone please help me how to get thy latest entry in my table
my query is


SELECT
a.transid,
a.artid,
b.remarks,
b.errID

FROM tbl_transactions as a
inner join tbl_errordetail as b on (b.transid = a.transid)

where a.artid = 123


i want to get the latest entry for b.errID without grouping by

thanks in advance

scsi
12-09-2008, 07:07 AM
There really is no way to get the last row unless you have some sort of datetime column. You can use LIMIT 1 in your select statement.