Hi,

I'm not sure if this is correct, I'm learning too...
could something like this work:

select table1.field1, table2.description from table1 left join table2
on (tabl1.field1 = table2.identifier)

if table2 doesnt contain a description it will return NULL

or if you want to skip 0

try

select table1.field1, table2.description from table1 left join table2
on (tabl1.field1 = table2.identifier) where table1.field1 > 0

Ryan.
www.badblock.com


On 7/22/05, Pete <[EMAIL PROTECTED]> wrote:
> 
> I am currently stuck on this:
> table1.field1 contains a number.  With this number I can get the
> description that the number looks up,
> ... table2.description WHERE table1.field1=table2.identifier
> 
> But, what if table1.field1 is 0 - the item to be looked up has not been
> defined.
> 
> I could put 0 in table2 (MySQL whines but works), but there should be
> someway of saying "don't pickup table2.description when table1.field1 is
> set to 0"
> 
> --
> Pete Clark
> 
> http://www.hotcosta.com
> http://www.spanishholidaybookings.com
> 
> 
> 
> 
> The php_mysql group is dedicated to learn more about the PHP/MySQL web 
> database possibilities through group learning.
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
>




The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to