> Now the strange thing is that this query returns the correct number of rows,
> but all the columns from the employee-table are empty.

There's no "employee-table" in your query.

> If I change "UNION" to "UNION ALL" the join works as expected.
> Is there an explanation for this behavior ?

As we don't see your query we can't explain what's going on there.

> Also when I add an order clause, the left columns are all made empty ?

Justing adding ORDER BY changes all "left" (from what?) columns in all
rows to NULL? No way! Show the actual output from sqlite3 command line
utility please.

> Is it uberhaupt possible to order the resulting table on the column PID
> and preferable get just 1 PID column ?

Sure, why not? But again no query - no advice on how to correct it to
achieve what you want.

Pavel

On Thu, Sep 17, 2009 at 6:39 PM, Stef Mientki <s.mien...@ru.nl> wrote:
> hello,
>
> I'm trying to join 2 tables,
> so I guess I need to perform a full outer join.
>
> On wikipedia, I found this solution for sqlite3:
> http://en.wikipedia.org/wiki/Join_%28SQL%29
>
> select *
>  from RT0
>    left join RT1 on RT1.PID = RT0.PID
>  union
>    select RT0.*, RT1.*
>      from RT1
>        left join RT0 on RT1.PID = RT0.PID
>    where RT0.PID IS NULL
>
> Now the strange thing is that this query returns the correct number of rows,
> but all the columns from the employee-table are empty.
>
> If I change "UNION" to "UNION ALL" the join works as expected.
> Is there an explanation for this behavior ?
>
> Also when I add an order clause, the left columns are all made empty ?
>
> Is it uberhaupt possible to order the resulting table on the column PID
> and preferable get just 1 PID column ?
>
> thanks,
> Stef
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to