Or.. Select * from emp order by id asc limit 0,1 if you want to  fetch
all details.

-----Original Message-----
From: Jason McKnight [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 7:21 PM
To: [EMAIL PROTECTED]
Subject: Re: Reg SubQuery

You could also do it like this:

select min(id) from emp;


Roger Baklund wrote:

> [EMAIL PROTECTED] wrote:
>
>> I need to get all the details of an employee whose salary is the
lowest.
>> I can do like this in Oracle
>>
>>
>> select * from emp where id = (select min(id) from emp).
>>
>>
>> Can we have any alternative in MySQL for the above query, as sub 
>> queries are not supported in MySQL 4.0.21
>
>
> There is no need for a subquery in this case:
>
> select * from emp order by id limit 1;
>


--
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