Subject Re: mutiple select in a statement
Author Adam
--- In firebird-support@yahoogroups.com, "kevtey" <kevtey@...> wrote:
>
> i try to put a multiple select statement but it return error...
> this is the sql im trying to write
> -------------------------------------------------
> select c.* ,d.* from m_nationality c ,
> (select a.sector_id sector_ida,a.s_type ,b.* from (m_sector a left
> join M_ALWSECNAT b
> on a.sector_id = b.sector_id)) d
> where c.nationality_id = d.nationality_id
> -------------------------------------------------
> it return error..saying unknown select in line 2
> is there a way to do this. thanks.
>
> by the way i try this sql statement too it doesnt work as well.
> --------------------------------------------
> select a.*, b.* from m_sector a,
> ( select t.* from M_ALWSECNAT t)b
> where a.sector_id = b.sector_id
> --------------------------------------------
> same error... :(
>

This is not valid syntax. You can include queries that return a
single field as a field, but this only works if the query only
returns a single row.

It looks to me you are only after a normal join anyway?


____

select c.* ,d.*, a.sector_id sector_ida, a.s_type, b.*
from m_nationality c
join m_sector a on (c.nationality_id = a.nationality_id)
left join M_ALWSECNAT b on (a.sector_id = b.sector_id)

____

select a.*, b.*, t.*
from m_sector a
join M_ALWSECNAT t on (a.sector_id = b.sector_id)

____

Adam