All Forums Database
sethiyagu 19 posts Joined 11/04
14 Jul 2006
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

Fred 1096 posts Joined 08/04
14 Jul 2006

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 1This feature is a Teradata extension introduced in V2R6.

You must sign in to leave a comment.