Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Re: Merging SQL Results

by johnirl (Monk)
on Aug 05, 2002 at 08:40 UTC ( [id://187608]=note: print w/replies, xml ) Need Help??

in reply to Re: Merging SQL Results
in thread Merging SQL Results

Ok I'm obviously not after making myself clear. Probably for the same reason you have no SQL samples in your answer ;-)
Basically what I want to do is display two tables beside each other. Thats it. So say I have two statements  select name, address fom table1 where age > 20 and country = "Ireland" select name, address fom table1 where age > 20 and country = "Germany" instead of displaying two tables one above the other (as below) I'd like to merge them (as further below)

Ireland; john;cork;21; pat;dublin;22; Eoin;galway;33; Germany; holger;stuttgart;21; jens;berlin;22; stefan;dresden;23;

Ireland; Germany; john ; cork ; holger ; stuttgart ; 21 ; pat ; dublin ; jens ; berlin ; 22 ; Eoin ; galway ; -- ; -- ; 33 ; -- ; -- ; stefan ; dresden ; 23 ;

j o h n i r l .

Sum day soon I'Il lern how 2 spelI (nad tYpe)

Replies are listed 'Best First'.
Re: Re: Re: Merging SQL Results
by physgreg (Scribe) on Aug 05, 2002 at 09:49 UTC
    From my rather hazy recollection of SQL:
    SELECT, ir.address,, ge.address, ir.age, ge.age FROM table1 AS ir OUTER JOIN table1 AS ge ON ir.age = ge.age WHERE ir.age > 20 AND ( = 'Ireland' AND = 'Germany') OR ( = 'Germany' AND IS NULL) OR ( = 'Ireland' AND IS NULL)
    I haven't been able to test this, so please let me know if it works!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://187608]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-05-30 00:12 GMT
Find Nodes?
    Voting Booth?

    No recent polls found