Home » SQL & PL/SQL » SQL & PL/SQL » Function MAX (Oracle 11g)
Function MAX [message #658051] Thu, 01 December 2016 09:40 Go to next message
tomekw
Messages: 5
Registered: December 2012
Junior Member
Hello,
What to ask a question for this set to receive a record containing the value DATA for the maximum value of the field NUMBER?

Data Number
abc 1
abc 2
cde 3
vfr 4
bgt 5
abc 6

It is expected as a result of:

Data Number
abc 6

Is it to be done?

Regards
Tom
Re: Function MAX [message #658052 is a reply to message #658051] Thu, 01 December 2016 09:51 Go to previous messageGo to next message
tomekw
Messages: 5
Registered: December 2012
Junior Member
Expand the question:
What kind of question to ask of the data obtained such a result?

Order Name Number
K100 abc 1
K100 abc 2
K100 cde 3
K100 vfr 4
K100 bgt 5
K100 abc 6
K200 abc 1
K200 abc 2
K200 cde 3
K200 vfr 4
K200 bgt 5
K400 abc 1
K400 abc 2
K400 abc 3
K500 cde 1
K500 vfr 2
K500 bgt 3
K500 abc 4
K500 abc 5
K500 abc 6
K500 cde 7
K500 vfr 8


Result:

K100 abc 6
K200 bgt 5
K400 abc 3
K500 vfr 8
K% % MAX

Re: Function MAX [message #658053 is a reply to message #658052] Thu, 01 December 2016 10:03 Go to previous messageGo to next message
BlackSwan
Messages: 26187
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

Re: Function MAX [message #658054 is a reply to message #658051] Thu, 01 December 2016 10:08 Go to previous message
Michel Cadot
Messages: 65841
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

1/ We don't do homework.
2/ Post what you already tried.
3/ With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data.
4/ Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
5/ Align the columns in result.
6/ Also always post your Oracle version, with 4 decimals, as solution depends on it.

Previous Topic: how to search for two characters in any sequence, with or without alphanumeric characters in between
Next Topic: ora-06504 PL/SQL: Return types of Result Set variables or query do not match
Goto Forum:
  


Current Time: Tue Oct 16 19:36:55 CDT 2018