Home » SQL & PL/SQL » SQL & PL/SQL » highest value ( sql,10g,windows xp)
highest value [message #444810] Wed, 24 February 2010 05:37 Go to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi


I have an table named as rawdata.I need output comes

F_DATE MAGNITUDE
--------- ----------

11-JAN-10 9


create table rawdata(f_date date,magnitude number);

select * from rawdata;

F_DATE     MAGNITUDE
--------- ----------
10-JUN-09          6
10-DEC-09          6
11-JAN-10          7
11-JAN-10          8
11-JAN-10          9



thanks and regards

varosh

[Updated on: Wed, 24 February 2010 05:43]

Report message to a moderator

Re: highest value [message #444816 is a reply to message #444810] Wed, 24 February 2010 05:49 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
What kind of output ...Max min avg count ?
Re: highest value [message #444819 is a reply to message #444810] Wed, 24 February 2010 05:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select max(magnitude) from rawdata;

If you post a working Test case: create table and insert statements along with the result you want with these data then we will work with your table and data.

Regards
Michel

[Updated on: Wed, 24 February 2010 05:55]

Report message to a moderator

Re: highest value [message #444822 is a reply to message #444819] Wed, 24 February 2010 05:59 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
hi

i need maximum magntitude of same date. In that table 11-JAN-10 has comes 3 times .So i want maximum magnitude of that date

Thanks and regards

varosh
Re: highest value [message #444823 is a reply to message #444822] Wed, 24 February 2010 06:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select f_date, max(magnitude) from rawdata group by f_date;

Regards
Michel
Re: highest value [message #444840 is a reply to message #444822] Wed, 24 February 2010 08:00 Go to previous message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
varosh81 wrote on Wed, 24 February 2010 06:59
hi

i need maximum magntitude of same date. In that table 11-JAN-10 has comes 3 times .So i want maximum magnitude of that date

Thanks and regards

varosh


I would think that after 2 years and 175+ posts that you would know the most basic of aggregate functions.
Previous Topic: Constraint Issue (merged)
Next Topic: Find two or more consecutive dates
Goto Forum:
  


Current Time: Sun Dec 11 06:29:05 CST 2016

Total time taken to generate the page: 0.12298 seconds