RE: SELECT .. OR from multiple tables

2001-08-15 Thread Eric Anderson
> >> How about a UNION query...? > > >Too bad MySQL doesn't support them yet ;) > > Oops...sorry...I see it is on the TODO list. > > Would a MERGE table not achieve the same result as a UNION query? It > appears that a MERGE table acts like a VIEW. > > Eric if your Current and Temporary tables ha

RE: SELECT .. OR from multiple tables

2001-08-15 Thread Bruce Stewart
>> How about a UNION query...? >Too bad MySQL doesn't support them yet ;) Oops...sorry...I see it is on the TODO list. Would a MERGE table not achieve the same result as a UNION query? It appears that a MERGE table acts like a VIEW. Eric if your Current and Temporary tables have identical str

RE: SELECT .. OR from multiple tables

2001-08-14 Thread Dave Rolsky
On Tue, 14 Aug 2001, Bruce Stewart wrote: > How about a UNION query...? Too bad MySQL doesn't support them yet ;) -dave /*== www.urth.org We await the New Sun ==*/ - Before posting, please ch

Re: SELECT .. OR from multiple tables

2001-08-14 Thread Eric Anderson
> Your query will work in every case, EXCEPT when either "Current" or > "Temporary" has 0 rows, because then there's nothing to join. I'm not sure > if doing a join is a "clean" way of doing this though. > > If you know that "Current" will never be empty (but "temporary" might be), > then this que

RE: SELECT .. OR from multiple tables

2001-08-14 Thread Eric Anderson
> How about a UNION query...? Hmm.. that construct is a little ugly for me - I think I'd rather just issue two quick queries in each table. Thanks for the tip though.. I missed that one. > I've got two tables, "Current" and "Temporary", Current has a row with > login='keric', Temporary doesn't.

Re: SELECT .. OR from multiple tables

2001-08-14 Thread Philip Mak
Your query will work in every case, EXCEPT when either "Current" or "Temporary" has 0 rows, because then there's nothing to join. I'm not sure if doing a join is a "clean" way of doing this though. If you know that "Current" will never be empty (but "temporary" might be), then this query would wo

RE: SELECT .. OR from multiple tables

2001-08-14 Thread Bruce Stewart
How about a UNION query...? -Original Message- From: Eric Anderson [mailto:[EMAIL PROTECTED]] Sent: Tue, 14 August 2001 18:56 To: [EMAIL PROTECTED] Subject: SELECT .. OR from multiple tables I've got two tables, "Current" and "Temporary", Current ha

SELECT .. OR from multiple tables

2001-08-14 Thread Eric Anderson
I've got two tables, "Current" and "Temporary", Current has a row with login='keric', Temporary doesn't. The following query: mysql> select * from Current, Temporary where Current.login='username' or Temporary.login='username' -> \g Empty set (0.01 sec) obviously doesn't work. I want to k