dbTalk Databases Forums  

filter for SQL commad ?

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss filter for SQL commad ? in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joseph
 
Posts: n/a

Default filter for SQL commad ? - 09-29-2005 , 02:36 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-filte...ict259609.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=894697

Reply With Quote
  #2  
Old   
Tony Sebion
 
Posts: n/a

Default Re: filter for SQL commad ? - 09-29-2005 , 03:34 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 (AT) dbForumz (DOT) com> wrote


Quote:
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-filte...ict259609.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=894697


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.