Suppose I have table with the following structure -
Create table TblInfo(Name varchar(20), Email varchar(30))
Note that I have not put any constraints or setup any relationship on this table. No index No primary key.
Now I insert 5 records into this table
insert into TblInfo('abc', 'abc@dbforums.com')
insert into TblInfo('def', 'def@dbforums.com')
insert into TblInfo('ijk', 'ijk@dbforums.com')
insert into TblInfo('lmn', 'lmn@dbforums.com')
insert into TblInfo('opq', 'opq@dbforums.com')
What will be the sql query to retrieve Last 3 inserted records?
Above is just a scenario I created for illustrating the problem. The generic question I have is - How to retrieve Last n inserted records from an un-indexed table (having no primary key or index)?