[Show all top banners]

Saajha
Replies to this thread:

More by Saajha
What people are reading
Subscribers
Subscribers
[Total Subscribers 1]

Slackdemic
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 SQL HELP!
[VIEWED 1521 TIMES]
SAVE! for ease of future access.
Posted on 02-21-06 6:15 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Need a quick help from the DB experts:

I have two tables:

HOURS

SSN Start End ID
--- --- --- 3
--- --- --- 3
--- --- --- 5
--- --- --- 5
--- --- --- 5
--- --- --- 5

LOCATION

Addr Num
--- 1
--- 2
--- 3
--- 4
--- 5

On the first table, the value of SSN is redundant, so is the ID; therefore there's no particular Primary Key choice. However, a composite key can be used taking SSN and ID together, which makes the combined fields unique.
Now, the Num and ID are related (i.e., HOURS.ID = Location.Num).

The problem:
Listing the ones that are absent in ID, but are present in Num, which means the output should be :

1
2
4
or anything representing them, such as the list of 'addr's corresponding to 1,2 and 4.

I spent too much of time on this. Hope someone knows the way out.
 
Posted on 02-21-06 6:22 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Try this:
Select * From Location Where NUM Not IN (Select ID From HOURS)

Good Luck.
 
Posted on 02-21-06 6:38 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

That's it. Thank You slipKnot I W!! It didn't work on mysql, and was about to quit, but I thought I might as well try on postgres, and it did work. Thnx again!
 
Posted on 02-21-06 11:21 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Anyone know how to implement stored procedure in Access db.. i know its dumb.. but just curious..
 
Posted on 02-21-06 11:46 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Heya,
you might find this helpful James Bond:

http://www.stardeveloper.com/articles/display.html?article=2001050101&page=1
 
Posted on 02-23-06 8:55 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thanks Virus..
appears to be a good resource!
 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 200 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration
What are your first memories of when Nepal Television Began?
निगुरो थाहा छ ??
ChatSansar.com Naya Nepal Chat
TPS Re-registration case still pending ..
Basnet or Basnyat ??
Sajha has turned into MAGATs nest
NRN card pros and cons?
Do nepalese really need TPS?
कता जादै छ नेपाली समाज ??
Nas and The Bokas: Coming to a Night Club near you
Will MAGA really start shooting people?
Democrats are so sure Trump will win
मन भित्र को पत्रै पत्र!
Top 10 Anti-vaxxers Who Got Owned by COVID
I regret not marrying a girl at least for green card. do you think TPS will remain for a long time?
TPS Work Permit/How long your took?
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
Breathe in. Breathe out.
3 most corrupt politicians in the world
Nas and The Bokas: Coming to a Night Club near you
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters