[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] mysql not giving any result



----- Original Message -----
From: "Brian Feliciano" <brian@xxxxxxxxxxxxxxxxx>


> i have this SELECT query that it doesn't show any result..
> it is very inconsistent, it works with other fields but it doesn't with
> others...
> and the sad part is, it doesn't give any error msgs.
>
> i don't if my other database is growing rapidly(i have more than 400 tables)
> causes this.
>
> i'll give you the genearated sql statement:

Are you sure you don't want an outer join?
What you have is an inner join, and will only show a product if it has a dim_unit and a wt_unit and a manufacturer. If any of these
are missing, no row will appear.

Try *= (or =*) instead of = for an outer join.

Cheers,
Ben Liddicott


> >>>>>>>>>>>>>>>>>>>>>>>>.
> SELECT products.id,products.itemname,products.fullpic, products.ourprice,
> products.otherprice, products.description,
> products.ingredients,products.featspecs, products.export, products.lent,
> products.width, products.height, dim_unit.abbr, products.weight,
> wt_unit.abbr, manufacturer.name, products.datemanuf, products.country,
> products.order_inst FROM products, dim_unit, wt_unit, manufacturer WHERE
> products.id='11' AND dim_unit.id=products.dimunit AND
> wt_unit.id=products.wtunit AND manufacturer.id=products.manufacturer