Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

3-1 in Outer Query

This is a discussion on 3-1 in Outer Query within the SQL forums, part of the Databases category; select salary from employees e where 3-1=(select count (distinct salary) from employees where salary >e.salary); What is 3-1 in outer query?...

Go Back   Geeks Talk > Databases > SQL
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 10-12-2009
Junior Member
 
Join Date: May 2008
Location: mumbai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
smay4all is on a distinguished road
3-1 in Outer Query

select salary from employees e where 3-1=(select count (distinct salary) from employees where salary >e.salary);

What is 3-1 in outer query?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-12-2009
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: 3-1 in Outer Query

that is a simple subtraction and it is compared the count of inner query.
Reply With Quote
  #3 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Sep 2009
Location: hyderabad
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
siddu.c is on a distinguished road
Re: 3-1 in Outer Query

please explail detail 3-1 in Outer Query
Reply With Quote
  #4 (permalink)  
Old 2 Weeks Ago
Expert Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 515
Thanks: 29
Thanked 63 Times in 61 Posts
susarlasireesha will become famous soon enough
Re: 3-1 in Outer Query

just finding 3rd highest salary in emp table..
__________________
Sireesha
Reply With Quote
  #5 (permalink)  
Old 2 Weeks Ago
Junior Member
 
Join Date: Jun 2009
Location: hyderabad
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
imtiazali is on a distinguished road
Re: 3-1 in Outer Query

it will get 2nd lowest salary
bcoz 3-1 is 2 , in the inner query u have mentioned the condition salary >e.salary .
it will sort in assending order
Reply With Quote
  #6 (permalink)  
Old 1 Week Ago
Junior Member
 
Join Date: Jun 2009
Location: hyderabad
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
imtiazali is on a distinguished road
Re: 3-1 in Outer Query

it will give the 2nd highest sal
Reply With Quote
Reply

  Geeks Talk > Databases > SQL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Outer Join Between Dimension tables Himanshu_sh Data Warehousing 1 03-06-2009 06:40 AM
SQL Server outer join chitrab SQL Server 3 03-28-2008 04:51 AM
Outer Join Query Example mailtos.ravi SQL 4 03-05-2008 04:34 AM
Recognising only outer form boundary Geek_Guest QTP 1 03-03-2008 02:06 AM
Writing query with LEFT OUTER JOIN N SRIRAM K Data Warehousing 5 09-03-2007 06:08 AM


All times are GMT -4. The time now is 02:52 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved