[ale] MySQL Question

Christopher Fowler cfowler at outpostsentinel.com
Thu Apr 1 09:45:30 EST 2004


On Thu, 2004-04-01 at 09:38, George Carless wrote:
> On Thu, Apr 01, 2004 at 09:08:38AM -0500, Yu, Jerry wrote:
> > Not sure what exactly do you mean by 'to speed this up'...
> > 
> > 
> > To answer the question of 'consolidate into one SQL statement"
> > 1) use subqueries:
> > select * from users where ID in ( select User_ID from ALARMS where ID = 1 );
> > 
> > or 2) define a view.
> 
> YUCK!  Are you coming from MS SQL Server or something? ;p 

H*ll no!  MySQL is all I use.  Unless it is SQLlite.

> 
> What's wrong with a join?
> 
> select * from users inner join ALARMS on users.user_id = ALARMS.user_id WHERE ALARMS.ID=1;
> 
> Using nested SELECT statements when a join is the right tool for the job is.. nasty.
> 
> Cheers,
> --George
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list