Home > Archive > MySQL Server Forum > August 2005 > Newbee Subselect question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Newbee Subselect question
Magnus

2005-08-15, 7:23 am

Hi,

I have previously worked mostly with Sql Server and wonder how to write
a subselect query in mysql 4.0. What i would like to do is something
like:

select a.name, b.isbn
from author a
left outer join isbn b on b.authorid in(select id from author)

When trying to running the query i get a syntax error near (select id
from author). How do i write a subquery like "in (select id from
author)"? Please ignore the rest of the query, it's just a poor example
:-)

Regards

//Magnus

Aggro

2005-08-15, 9:23 am

Magnus wrote:

> I have previously worked mostly with Sql Server and wonder how to write
> a subselect query in mysql 4.0.


Subselects are supported from version 4.1, which means that you can't
write them with MySQL 4.0 at all (you can instead use joins in most cases).

http://dev.mysql.com/doc/mysql/en/subqueries.html
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com