First of all, you query is not correct and this is not a subselect query.
you can try this:

SELECT Salary, Level, Department FROM SalaryInfo ORDER BY Salary DESC LIMIT
1;

second of all, for subselect MySQL 4.1 can help you.

Mojtaba

----- Original Message ----- 
From: "Prashant Pai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 24, 2003 12:00 PM
Subject: SUBSELECT QUESTION?


> Hi,
>
> I have a table SalaryInfo as below
>
> Salary | Department | Level
> 500000 | R&D        | Director
> 30000  | Maintenance| Groundsman
> .......
>
> I want to know what level in each department makes the highest salary
> and how much that salary is? Something like:
>
> SELECT Salary, Level, Department FROM SalaryInfo WHERE
> Salary=Max(Salary)
>
> Would using MySQL 4.1 that has support for nested select help my case?
>
> Thanks in advance
> prashant
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to