[Show all top banners]

Ghiraunla
Replies to this thread:

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

fi_nepali
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 Help in SQL Query
[VIEWED 14420 TIMES]
SAVE! for ease of future access.
Posted on 05-02-17 6:01 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Hi SQL Gurus,

I need to join two tables say Table I and Table W

Table I is like below

Numbers Values
1 A
1 B
2 C
3 D

Table W is Like Below
Numbers Boolean
1 Yes
1 Yes
2 Yes
3 Yes

I need to query to join Table I and W where Boolean value is Yes in Table W but there is no D in Table I in Oracle database. The answer would be
Number
1
2
Can someone help me get a query?

 
Posted on 05-02-17 7:45 AM     [Snapshot: 61]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Hey, your requirement is confusing. What does it mean by "where Boolean value is Yes in Table W but there is no D in Table I in Oracle database"

 
Posted on 05-02-17 7:45 AM     [Snapshot: 57]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

If there is no value D in table I then when you join both the tables on numbers, you will automatically get the those two numbers as you distinct them. Not sure, what your question is actually?
 
Posted on 05-02-17 8:41 AM     [Snapshot: 108]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

First join like this:
select i.Numbers as Number from I i join W w on i.Numbers = w.Numbers
Then use filter to get the record you need:
where w.Boolean="Yes" and i.Values != 'D'

Actual query depends on database you are using.
 
Posted on 05-02-17 9:29 AM     [Snapshot: 142]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

try this..very generic

select * from i where values  <> 'D' and numbers in (select numbers from w where boolean = 'Y')

- Jaxnepali
Last edited: 02-May-17 09:29 AM

 
Posted on 05-02-17 12:11 PM     [Snapshot: 237]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

There is an online application for testing and sharing SQL queries called SQLFiddle.com.
Here's a quick fiddle I created for you.
http://sqlfiddle.com/#!9/393cc/4

 
Posted on 05-02-17 12:34 PM     [Snapshot: 250]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

are you interested in basic to advance level SQL training please contact [email protected]

-----
New QA training session starting this wednesday( 05/02/2017)
 
Posted on 05-02-17 12:49 PM     [Snapshot: 274]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

ikauda,
How much do you charge for your trainings?

Thank you,
Dania

Dania Chhetri
Senior Resource Manager
Geek IT Solution LLC
Email: [email protected]
Direct: 972-358-3131
Linkedin: Dania Chhetri
Google Hangout: [email protected]

Note: If you were unable to reach me please contact our President, Santosh Bhattarai at [email protected] or you may call him at: 913-515-5346. He can also be reached on hangouts at: [email protected]
 
Posted on 05-02-17 1:29 PM     [Snapshot: 303]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

zero cost....... thousands to benefit ( to candidates)...... 
Last edited: 02-May-17 01:29 PM
Last edited: 02-May-17 01:31 PM

 


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 60 days
Recommended Popular Threads Controvertial Threads
Democrat wants to run election like in India. Chaos and Confusing to voters.
Breaking News: Ninth Circuit Rejects Government Bid to Undo Nepal TPS Order, Leaves Protections in Place
рдП рез рдкрдирд┐ рдкреБрдЧреЗрдирдЫ ?
рдиреЛрдмреЗрд▓ рд╢рд╛рдиреНрддрд┐ рдкреБрд░рд╕реНрдХрд╛рд░ рд░ рдЕрд╢рд╛рдиреНрдд рд░рд╛рд╖реНрдЯреНрд░рдкрддрд┐рдХреЛ рдмрд╛рд▓рд╣рда
200 denaturalization cases per month to the Department of Justice for the 2026 fiscal year.
рдиреЗрдкрд╛рд▓реА рд╡рд╛рд▓рдорд╛рд░реНрдЯ рдЪреЛрд░
Funny when Nepalis talk about Epstein and injustice
рдорд╛рдирд╕рд┐рдХ рд╕рдиреНрддреБрд▓рди, рдПрдХ рдХрд╣рд╛рд▓реАрд▓рд╛рдЧреНрджреЛ рдШрдЯрдирд╛ рд╕рд┐рдХреНрдиреБрдкрд░реНрдиреЗ рдХреБрд░рд╛рд╣рд░реБ
рдорд┐рд░реЛ рдкреНрд░реЗрдбрд┐рдХреНрд╢рди рдЬрдиреНрдореЗрд░ рдПрдореЗрд░рд┐рдХрд╛рдорд╛ рдЖрдЦрд╛ рдЦреЛ рд▓ рди рдкрд╛рдпреЗрдХрд╛ рдирд╛рдЧрд░рд┐рдХрддрд╛ рдмрд╛рд░реЗ
рдмрд╛рд▓реЗрдВрди рдЖрдП рдкрдЫрд┐ рдЖрд╢рд╛рдХрд╛ рдХрд┐рд░рдг рджреЗрдЦрд┐рди рдерд╛рд▓реЗрдХрд╛ рдЫрдиреН !!
Why Oli must go for the UML to survive?
рдмрд╛рд▓реЗрдВрди рдореЗрдпрд░ рдмрд╛рдЯ рдкреНрд░рдзрд╛рди рдордиреНрддреНрд░рд┐ рд╣реБрдиреЗ рднреЛ ?
Can we really get rid of Nepotism in the government?
рдЖрд░рдХреЛ рдиреЗрдкрд╛рд▓реАрд▓реЗ рдмреЗрдЬрдд рдЧрд░реНрдпреЛ рдлреЗрд░реА рдЕрд░рд╡рд┐рдВрдЧ рдЯреЗрдХреНрд╕рд╛рд╕рдорд╛ рдмреБрдврд╝рд╛рд╣рд░реВ рд▓рд╛рдИ рд╕реНрдХреЙрдо рдЧрд░реЗрд░
How many ministries do we really need?
When will the culture of impunity end?
рдиреЗрдкрд╛рд▓реА рд╕рд╕реБрд░реЛрд▓реЗ рд╡рд░реНрдЬреАрдирд┐рдпрд╛рдорд╛рдБ рдЖрдлрд╝рдиреЛ рдЫреЛрд░реА рдирд╛рддреА рд░ рдЬреНрд╡рд╛рдИрд▓рд╛рдИ рдЦреБрдХреБрд░реА рдкреНрд░рд╣рд╛рд░
Why Prachanda seems to be the smartest of them all?
When will Nepali women be equal?
Sukulgunda 2.0 / www.sukulgunda.com
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 [email protected] 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