Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] [OT] Help needed with an SQL Join


* This one time, at band camp, Tony Green said:
> > select TIME_STAMP, USERNAME, ACCTSESSIONID, OCCTSIN, OCCTSOUT
> > from radius.accounting
> > where TIME_STAMP between XXXX and XXXX 
> > UNION
> > select TIME_STAMP, USERNAME, ACCTSESSIONID, OCCTSIN, OCCTSOUT
> > from radius2.accounting
> > where TIME_STAMP between XXXX and XXXX
> > order by TIME_STAMP

This is the solution (needs tidying - but you get the idea)

CREATE TEMPORARY TABLE tmp type=HEAP SELECT * FROM ACCOUNTING;
INSERT INTO tmp SELECT * FROM radius2.ACCOUNTING;
SELECT * FROM tmp ORDER BY USERNAME;
DROP TABLE tmp;

-- 
Greeno <tgreen@xxxxxxxxxxxxxx>
GnuPG Key :  1024D/B5657C8B 
Key fingerprint = 9ED8 59CC C161 B857 462E  51E6 7DFB 465B B565 7C8B

Imagine working in a secure environment and finding the string 
_NSAKEY in the OS binaries without a good explanation
    -Alan Cox 04/05/2001