General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 26th, 2012, 12:01 PM
lightCGI lightCGI is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 1 lightCGI User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 6 sec
Reputation Power: 0
Complicated Select Statement (Noob)

I need a select statement and my brain is mush right now


I have two tables
first table has first column as primary and incrimental
so it looks like this

[U]nameID[/U] Name
1 bob
2 don

second table looks like this

[U]noteID[/U] nameIDNotes
1 1 Text
2 2 Text

I need to find out which nameID's in the first table were created that do not have a nameID in the second table of notes


simple but ugggg please help

Reply With Quote
  #2  
Old June 23rd, 2012, 07:24 PM
bitsmed bitsmed is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 11 bitsmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 59 m 53 sec
Reputation Power: 0
Quote:
Originally Posted by lightCGI
I need a select statement and my brain is mush right now


I have two tables
first table has first column as primary and incrimental
so it looks like this

[U]nameID[/U] Name
1 bob
2 don

second table looks like this

[U]noteID[/U] nameIDNotes
1 1 Text
2 2 Text

I need to find out which nameID's in the first table were created that do not have a nameID in the second table of notes


simple but ugggg please help


Code:
select nameid
  from firsttable
 where not exist (select *
                    from secondtable
                   where secondtable.nameid=firsttable.nameid
                 )

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Complicated Select Statement (Noob)


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap