vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| "Joseph" <UseLinkToEmail@dbForumz.com> wrote in message news:4_895190_c1aab00d94e6aa5ec49c937f01815b40@dbf orumz.com... > Hi, > I don’t 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’) |