Re: [sqlite] full outer join questions

2009-09-19 Thread Stef Mientki
Pavel Ivanov wrote: >> select coalesce(RT1.PID, RT2.PID) as PID, RT1.V1, RT2.V2 ... >> > > I find function ifnull() more readable in such cases. ;-) > > thanks guys, both (of course ;-) works perfectly. I have to study the functions in SQLite some more !! cheers, Stef

Re: [sqlite] full outer join questions

2009-09-19 Thread Pavel Ivanov
> select coalesce(RT1.PID, RT2.PID) as PID, RT1.V1, RT2.V2 ... I find function ifnull() more readable in such cases. ;-) Pavel On Fri, Sep 18, 2009 at 7:21 PM, Igor Tandetnik wrote: > Stef Mientki wrote: >> create table RT1 ( PID integer, V1 text ); >>

Re: [sqlite] full outer join questions

2009-09-18 Thread Igor Tandetnik
Stef Mientki wrote: > create table RT1 ( PID integer, V1 text ); > insert into RT1 values ( '684', 'aap' ); > insert into RT1 values ( '685', 'other empty' ); > create table RT2 ( PID integer, V2 text ); > insert into RT2 values ( '684', 'beer' ); > insert into RT2 values (

Re: [sqlite] full outer join questions

2009-09-18 Thread Stef Mientki
thanks Pavel, and sorry for mixing the wikipedia example with the real situation. create table RT1 ( PID integer, V1 text ); insert into RT1 values ( '684', 'aap' ); insert into RT1 values ( '685', 'other empty' ); create table RT2 ( PID integer, V2 text ); insert into RT2 values ( '684', 'beer'

Re: [sqlite] full outer join questions

2009-09-18 Thread Pavel Ivanov
> 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

[sqlite] full outer join questions

2009-09-17 Thread Stef Mientki
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