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.

To find Maximum Salary

This is a discussion on To find Maximum Salary within the Oracle forums, part of the Databases category; To find Maximum salary from 5 tables ex: I having five tables 1.emp 2.dept 3.account 4.balance 5.sample I want to get maximum salary from 5 tables ?...

Go Back   Geeks Talk > Databases > Oracle
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Oracle Oracle 9i & Oracle 10g Knowledge Base Learn and Share Oracle Technology related articles, white papers, tutorials / study materials, example codes, FAQ's, Tips and Tricks.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008
Junior Member
 
Join Date: Apr 2008
Location: chennai
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
S.Ravi is on a distinguished road
To find Maximum Salary

To find Maximum salary from 5 tables

ex: I having five tables 1.emp 2.dept 3.account 4.balance 5.sample


I want to get maximum salary from 5 tables ?
Reply With Quote
The Following User Says Thank You to S.Ravi For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 04-17-2008
Junior Member
 
Join Date: Apr 2008
Location: chennai
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
S.Ravi is on a distinguished road
Re: To find Maximum Salary

[QUOTE=S.Ravi;28933]To find Maximum salary from 5 tables

ex: I having five tables 1.emp 2.dept 3.account 4.balance 5.sample


I want to get maximum salary from 5 tables ?
Reply With Quote
  #3 (permalink)  
Old 04-17-2008
Junior Member
 
Join Date: Apr 2008
Location: US
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
ashiexp is on a distinguished road
Re: To find Maximum Salary

Quote:
Originally Posted by S.Ravi View Post
To find Maximum salary from 5 tables

ex: I having five tables 1.emp 2.dept 3.account 4.balance 5.sample


I want to get maximum salary from 5 tables ?
hey dear,

Create the join of al five tables by using JOIN clause and then using SELECT MAX(sal) function extract the max salary from the joined table.

if u need exact code for that let me know
Reply With Quote
The Following User Says Thank You to ashiexp For This Useful Post:
  #4 (permalink)  
Old 04-18-2008
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: To find Maximum Salary

Kindly post the query that you are working on.
Reply With Quote
  #5 (permalink)  
Old 04-18-2008
Junior Member
 
Join Date: Apr 2008
Location: chennai
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
S.Ravi is on a distinguished road
Re: To find Maximum Salary

Quote:
Originally Posted by ashiexp View Post
hey dear,

Create the join of al five tables by using JOIN clause and then using SELECT MAX(sal) function extract the max salary from the joined table.

if u need exact code for that let me know
Yes, I need code for that, plz reply me
Reply With Quote
  #6 (permalink)  
Old 04-19-2008
Contributing Member
 
Join Date: Sep 2005
Posts: 53
Thanks: 3
Thanked 6 Times in 6 Posts
Beena is on a distinguished road
Re: To find Maximum Salary

It shoud work with little tweaking or no changes ..
select max(salary) as salary from table1
union all
select max(salary) as salary from table2
union all
select max(salary) as salary from table3
group by salary

Let me know if this works..
Reply With Quote
  #7 (permalink)  
Old 04-21-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: To find Maximum Salary

Quote:
Originally Posted by S.Ravi View Post
To find Maximum salary from 5 tables

ex: I having five tables 1.emp 2.dept 3.account 4.balance 5.sample


I want to get maximum salary from 5 tables ?
Dear Ravi,


How can members post query without knowing structure of your tables? Post the structure of your tables or query you tried so far?

Regards
Krishna
Reply With Quote
Reply

  Geeks Talk > Databases > Oracle

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
1st and 2nd Maximum salary through same SQL Query amarmail_999 SQL Server 4 03-25-2009 04:24 AM
Give example of mixmize and minimum salary find. bhushanbhangale SQL Server 2 03-06-2008 04:20 AM
What should be the maximum length of field Geek_Guest SAP R/3 1 02-01-2008 03:14 AM
employee name and salary from employee and salary table Himu SQL 1 07-04-2007 05:34 AM
Find the maximum number of numbers in the sequence jamesravid Brainteasers 10 12-06-2006 05:10 AM


All times are GMT -4. The time now is 11:56 AM.


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