Hello,
Select within a select statement is what i'm using in MS Access, but it doesn't seems te work in MySQL.
Database look
Table Hits
hit_id (autonumber)
hit_date
hit_ip
I just want to have the hit_date of the lowest hit_id, in access the query normaly looks like this:
SELECT hit_date FROM hits WHERE hit_id = (SELECT min(hit_id) as minid FROM hits)
In MySQL I get a error:
[Server01] ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT min(hit_id) as minid FROM hits)' at line 1
When I use the statements apart, he works fine. So like this:
SELECT hit_date FROM hits WHERE hit_id = 1
SELECT min(hit_id) as minid FROM hits
Does anyone has a sollution ?
Google search give me this, but is doens't work.(
http://www.squeekmachine.co.uk/code.php?s=5&c=17 )