Home > Archive > MS SQL Server Clients > September 2005 > filter for SQL commad ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author filter for SQL commad ?
Joseph

2005-09-29, 8:24 pm

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

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/Client-filt...pict259609.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=894697
Tony Sebion

2005-09-29, 8:24 pm

Is there a unique field in the table, where you could write a query
like:

DELETE FROM TAB WHERE UNIQUE_FIELD IN
(SELECT TOP 90 UNIQUE_FIELD FROM TAB WHERE (COL1= 'ABC' AND COL2='ABC'
AND ?????))

Good luck,
Tony Sebion


"Joseph" < UseLinkToEmail@dbFor
umz.com> wrote in message
news:4_894697_c2b2ed
0878532c267d72ee72a1
e9aff5@dbforumz.com:

> 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
>
> --
> Posted using the http://www.dbforumz.com interface, at author's request
> Articles individually checked for conformance to usenet standards
> Topic URL: http://www.dbforumz.com/Client-filt...pict259609.html
> Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=894697


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com