1

table schema

name            no_form
----            -------
john            16-0101-001
ahmad           16-0101-004
michael         16-0101-005
raja            16-0101-006
jason           16-0101-009
budi            16-0101-011

how to query to select last record from "no_form"?

hediguzo
  • 33
  • 4

1 Answers1

0

Your best option is to give the table an Auto Increment primary key and then you can sort and rely on that ID.

Antony
  • 3,875
  • 30
  • 32
  • bad advice do not rely on bigger id means later(in time) instert, save insertion time into a timestamp field – cske Sep 23 '16 at 07:33
  • But unless you are talking a LOT of data surely a timestamp will be bigger than an auto increasing int? And from the off as opposed to later in time. – Antony Sep 23 '16 at 07:38