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: Lukas Calmbach <lcalmbach_at_datacomm.ch>
Date: Sun, 26 Nov 2000 17:44:54 +0100
Message-ID: <3a22b511@news.datacomm.ch>

try this:
select cost, colour, partno from part where cost in ( select max(cost) from part)

greetings Lukas

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 - 10:44:54 CST

Original text of this message

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