SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 8th, 2004, 01:17 PM
Jimithang Jimithang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 6 Jimithang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 16 sec
Reputation Power: 0
Statement help

Need a little help with this.

Here is the statement I am using now:

select * from fileload
inner join gmpartsmaster on fileload.partnum = gmpartsmaster.partnum
where dealercode = '510571-03'

However, the data I want to see is what is left over in fileload.partnum, not the data I am actually bringing back with the statement.

Any help?

Reply With Quote
  #2  
Old September 8th, 2004, 02:12 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
Quote:
Originally Posted by Jimithang
However, the data I want to see is what is left over in fileload.partnum, not the data I am actually bringing back with the statement.

What?

Reply With Quote
  #3  
Old September 8th, 2004, 02:34 PM
Jimithang Jimithang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 6 Jimithang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 16 sec
Reputation Power: 0
Quote:
Originally Posted by Memnoch
What?

I know....I apologize....let me see if I can explain, and I'm sure there is an easier....I just don't know it.

I want to select from fileload.partnum that ARE NOT in gmpartsmaster.partnum

I tried:

select * from fileload
inner join gmpartsmaster on fileload.partnum != gmpartsmaster.partnum
where dealercode = '510571-03'

but that brings back everything (both fileload.partnum and gmpartsmaster.partnum) I just want to pull the partnumbers from fileload that are not in gmpartsmaster.partnum.

Reply With Quote
  #4  
Old September 8th, 2004, 03:36 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
select fileload.*, gmpartsmaster.partnum
from fileload Left join gmpartsmaster on fileload.partnum = gmpartsmaster.partnum
where (fileload.dealercode = '510571-03') and (gmpartsmaster.partnum is null);

S-

Reply With Quote
  #5  
Old September 8th, 2004, 03:41 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
Or
Code:
SELECT *
FROM fileload
WHERE partnum NOT IN
(
   SELECT DISTINCT partnum
   FROM gmpartsmaster
)

Reply With Quote
  #6  
Old September 8th, 2004, 04:19 PM
Jimithang Jimithang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 6 Jimithang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 16 sec
Reputation Power: 0
Thanks guys...those worked just fine. Appreciate it!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Statement help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT