Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > SQL statement slow


Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2003, 11:44 PM
thiamhong thiamhong is offline
Newcomer
 
Join Date: Aug 2002
Location: Malaysia
Posts: 18
Default SQL statement slow


i have two table, 1st contain 40,000++ record, 2nd contain 13,000 record, i wrote a statement

SELECT id FROM table1 WHERE id NOT IN (SELECT id FROM table2)

When i run this statement, it takes about 25 minute to show the result, anyone got any idea to use other way to retrieve the data.......

thank you
__________________
Sincere,
thiamhong :)
Reply With Quote
  #2  
Old 11-16-2003, 11:54 PM
00100b's Avatar
00100b 00100b is offline
Martian In Disguise

Retired Moderator
* Guru *
 
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
Default

What database engine are you using?
What data type is used for the [id] fields of both tables?
Is there an Index on the [id] fields in both tables?
__________________
The only stupid question is the one that goes un-asked.
Reply With Quote
  #3  
Old 11-17-2003, 03:01 AM
thiamhong thiamhong is offline
Newcomer
 
Join Date: Aug 2002
Location: Malaysia
Posts: 18
Default

microsoft access 97, the data type of the field is "Text"
__________________
Sincere,
thiamhong :)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL error in Vb Code blong824 Database and Reporting 16 03-14-2004 05:07 PM
SQL Statement Troubles verno_25_02 Database and Reporting 2 02-07-2003 05:49 PM
Problem with writing Twice Renidrag Web Programming 20 11-07-2002 02:52 PM
SQL Statement using like dejota6 Database and Reporting 17 11-05-2002 08:44 AM
Creating Access Databases TomGuy Database and Reporting 8 07-10-2002 10:56 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->