List:General Discussion« Previous MessageNext Message »
From:Thomas Lundström Date:June 25 2006 4:29pm
Subject:Re: if else statement
View as plain text  
fre 2006-06-23 klockan 01:52 -0400 skrev Michael Stassen:

> Thomas Lundström wrote:
>  > Not sure what you're aming for here and how your data is structured but
>  > why not use a join and alias and fetch all info in one select and then
>  > solve what you need in your code?
>  >
>  > Something in the line of:
>  >
>  > select t2.col2 from_t2, t3.col2 from_t3
>  > from table1 t1, table2 t2, table3 t3
>  > where t1.id = t2.id
>  >   and t1.id = t3.id
>  >   and t1.id = 3
>  >
>  > Maybe you can do something like that?
> 
> That may be a start, but you have the wrong condition on t1.id, and you've left 
> out any mention of t1.col1.  Also, explicit JOINs are better than implicit 
> (using commas) JOINs.
> 

Well of course you are correct, only probably you've missed the
intention. The error is the late-in-the-evening substitution of "t1.id =
3" where it should read "t1.col1 = 3" of course.

Yes, explicit JOINS are always better. These ones are though easier to
fiddle with! ;-)

Regards,

Thomas Lundström

 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> 
> �


Thread
if else statementSong Ken Vern-E1180421 Jun
  • Re: if else statementJørn Dahl-Stamnes21 Jun
  • Re: if else statementThomas Lundström21 Jun
    • RE: if else statementPeter Lauri21 Jun
RE: if else statementSong Ken Vern-E1180423 Jun
  • Re: if else statementMichael Stassen23 Jun
    • Re: if else statementThomas Lundström25 Jun