Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Using MAX( ) function in SQL.

Re: Using MAX( ) function in SQL.

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 26 Nov 2000 15:49:27 -0000
Message-ID: <975250766.15174.0.nnrp-14.9e984b29@news.demon.co.uk>

Think about the question as:

    select all the details from the row where the cost is

        (the maximum cost of all the rows in the table.)

--
Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Practical Oracle 8i:  Building Efficient Databases

Publishers:  Addison-Wesley
Book bound date: 8th Dec 2000
See a first review at:
http://www.ixora.com.au/resources/index.htm#practical_8i
More reviews at: http://www.jlcomp.demon.co.uk/book_rev.html



Jack Torrence wrote in message ...

>Hi
>
>I am having trouble with a question I have been set for
>uni.
>
>my table is as follows;
>
>part(partno, description, colour, cost);
>
>I need to use the MAX function, to select the row with the
>maximum cost, and the other 3 fields.
>
>SELECT MAX(cost), colour, partno
>FROM part;
>
>Why can`t I do this? what is wrong with the syntax, or am I missing
>something maybe.
>
>I have also tried
>
>SELECT MAX(cost), MAX(colour), MAX(partno)
>
>but that only selects the max of each individual field.
>
>Can anyone help?
Received on Sun Nov 26 2000 - 09:49:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US