Home » SQL & PL/SQL » SQL & PL/SQL » lowest sal
lowest sal [message #197730] Thu, 12 October 2006 08:06 Go to next message
ashish_pass1
Messages: 114
Registered: August 2006
Location: delhi
Senior Member
i want to get lowest sal from an emp. table without using min function?
can any one please.
thanx

[Updated on: Thu, 12 October 2006 08:25]

Report message to a moderator

Re: lowest sal [message #197732 is a reply to message #197730] Thu, 12 October 2006 08:13 Go to previous messageGo to next message
joy_division
Messages: 4642
Registered: February 2005
Location: East Coast USA
Senior Member
Here we go again. Why not use the tools that Oracle provides to you? Is this homework or a test question?
Re: lowest sal [message #197736 is a reply to message #197732] Thu, 12 October 2006 08:27 Go to previous messageGo to next message
ashish_pass1
Messages: 114
Registered: August 2006
Location: delhi
Senior Member
i m new for oracle and just started it.
i m taking help of book & u.
if u r not suppose to help me then it's ok
thankxx

[Updated on: Thu, 12 October 2006 08:27]

Report message to a moderator

Re: lowest sal [message #197737 is a reply to message #197736] Thu, 12 October 2006 08:30 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Sort the records and limit the output to the first record. joy_division is right though: why does someone try to do this? Oracle has provided the MIN function. Use it.

MHE
Re: lowest sal [message #197776 is a reply to message #197730] Thu, 12 October 2006 11:20 Go to previous messageGo to next message
sujeethbala
Messages: 25
Registered: October 2006
Location: INDIA
Junior Member
use this

select sal from(select sal,rownum from emp order by sal) where rownum=1

u will get so many examples like this in forum. just go through.
Re: lowest sal [message #197870 is a reply to message #197776] Fri, 13 October 2006 00:56 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
I wrote on Thu, 12 October 2006 15:30

Sort the records and limit the output to the first record. joy_division is right though: why does someone try to do this? Oracle has provided the MIN function. Use it.

MHE


sujeethbala wrote on Thu, 12 October 2006 18:20

use this

select sal from(select sal,rownum from emp order by sal) where rownum=1

u will get so many examples like this in forum. just go through.


Hmm. No need to spell it out, Sujith, let the OP think a little bit for himself Wink

MHE
Re: lowest sal [message #197873 is a reply to message #197870] Fri, 13 October 2006 01:15 Go to previous message
sujeethbala
Messages: 25
Registered: October 2006
Location: INDIA
Junior Member
Maaher wrote on Fri, 13 October 2006 11:26


Hmm. No need to spell it out, Sujith, let the OP think a little bit for himself Wink
MHE

you r right maaher. i understood. OP will also understand soon.
Previous Topic: how to use oracles IRR function
Next Topic: I have a table contining 20 million records.
Goto Forum:
  


Current Time: Wed Dec 07 14:26:00 CST 2016

Total time taken to generate the page: 0.13219 seconds