Delete first record in a table

Database
Enthusiast

Delete first record in a table

Hi Teradata Guru's,

Is there any way to delete the first record in a table, by using delete statement & we should not use any column name.

To be more specific:
====================
select * from table sample 1; [It will display first record, like that I need to delete the first record of a table].

For example:
============
Delete from table(it should not specify column names in the sub-query)--> it should delete the first record.

Thanks in advance,
Stration
1 REPLY
Teradata Employee

Re: Delete first record in a table

There is no "first" record in a normal table. Using SAMPLE 1 returns a single row, but there's no guarantee it will be the same row every time. If you want to delete a single row you must qualify it based on column values.

Queue tables (FIFO ordered by INSERT timestamp) do allow
SELECT AND CONSUME TOP 1
This feature is a Teradata extension introduced in V2R6.