Hi
This nested query gives me a syntax error:
SELECT starttime, duration FROM mos_poly_activities WHERE actID = (SELECT lastactivity FROM mos_poly_lines WHERE linename = 'nettlinje');
But if I run the same two queries independently with the outer query using the result from the inner one, everything is ok.
The final result is an empty set, but that shouldn't effect the nested query I think.
Anyone know how to fix this error?
Regards tores
Help with nested sql-query
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
That's the issue then, subqueries are only supported from MySQL 4.1:
http://dev.mysql.com/doc/mysql/en/Subqueries.html
Mac
http://dev.mysql.com/doc/mysql/en/Subqueries.html
Mac