A relational database has no concept of "last N records entered", unless you have a field containing a sequence number or timestamp. There are no promises as to what order records will be retrieved in, unless you specify an ORDER BY sequence number or timestamp field. To limit to a given number of records, different SQL implementations use different keywords. Some use TOP and others use LIMIT (MySQL uses LIMIT). Your query might therefore be something like
SELECT city FROM transactions ORDER BY sequence_number DESC LIMIT 3;
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.