Posted by Reg on 09/30/05 19:38
"Joseph" <UseLinkToEmail@dbForumz.com> wrote in message
news:4_895190_c1aab00d94e6aa5ec49c937f01815b40@dbforumz.com...
> Hi,
> I dont know to write SQL command filter.
> m_strQueryDelete.Format("DELETE FROM tab WHERE (Col1 = abc AND Col2
> = abc AND ?????)"
> example: ODBC found 100 records.
> I need to delete first 90 records and to leave last 10 records.
>
> Thank you
>
> Joseph
Try this:
I will presume tabID is a primary key for the table:
DELETE
FROM tab
WHERE tabID IN (SELECT top 90 tabID FROM tab WHERE Col1 = abc AND Col2 =
abc)
Navigation:
[Reply to this message]
|