Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 rewriting my left self join
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

4 Posts

Posted - 04/30/2013 :  17:23:55  Show Profile  Reply with Quote
Hello my dear Friends

I have to tables

country : name,code,...

now i want to know if borders table is asymetrical , symetrical means for every country if there is a (fr,de) record in borders, there also should be ((de,fr) , otherwise it is asymetrical.

so i think i should have a join between these two tables,

SELECT NVL2 ( b.country1
, 'No'
, 'Yes'
FROM borders a
LEFT OUTER JOIN borders b ON b.country1 = a.country2
AND b.country2 = a.country1

now its writing some "yes" ...

but it should not generate a lot of record but just print out 'yes' or 'no'
if there is at least one Yes, the answer is Yes, if there are just No, the answer is No.

im using oracle 11g

thank you so much for your help
best regards

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 04/30/2013 :  17:36:56  Show Profile  Reply with Quote
This forum is for Microsoft SQL Server, so there are very few experts on Oracle here. You would get better and faster responses at an Oracle forum.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000